I believe has would work with twitter as well. So, always using twitter as the type, could be the best approach. Because in many other places inside Ghost codebase, it’s still named as “twitter”.
The code below, without being enclosed in {{#has}}, generated a 500 error, even though the social fields were filled in the admin section of the author’s profile.
I have fixed the type issue so that {{#social_accounts}} will output x as the type for twitter/x. That fix will go out in 6.39 today.
As for the 500 error I’ve tried both myself and using AI and cannot reproduce an error with this code if partials aren’t involved. So I think it’s roughly the same missing partial / type error (fixed in main).
Do you have an error message landing with the 500 http code? Or can you tell me how you’re adding the code? Are you editing locally or uploading a zip etc.
If I run the codeblock you gave through gscan using the new inline theme editor, I get this error from gscan:
Oops! You seemed to have used invalid Handlebars syntax. This mostly happens when you use a helper that is not supported.
See the full list of available helpers here.
Affected files:
author.hbs: Inlined dynamic partials like {{> (dynamicPartial) }} can result in page errors if the partial does not exist, use block dynamic partials instead.
Now that error message is admittedly about as much use as a chocolate teapot… but it’s pointing to the fact that if you use a dynamic partial name you’ll get unpredictable page errors if the partial is missing (which is exactly what you hit)… and that the way to work around it it is to use a block partial and a fallback: