0

If a given node (page, article, etc) is visited, their site title (generated by {{ head_title|safe_join(' | ') }} is displayed correctly:

My Page Title | Sample Website

If the same node is then configured to be the frontpage and is visited as such /, the title of the node gets pretty quotation marks added to it:

“My Page Title” | Sample Website

I've NO idea where these are coming from. I have been able to confirm this only happens in the front page node by changing the assigned node. This happens regardless of the type of node or content in it.

Dumping the head_title variable reveals that the quotation marks are already present when twig receives them. When looking at Devel, it shows that the title contains no quotes. I've already looked for custom code in the theme that would cause this with no luck. Of course, I can address this by replacing the characters in twig but it doesn't seem like the right way to go here.

My suspicion is that this is being caused by drupal/metatag but I've been unable to identify a configuration or line of code that may be causing this.

How would you go about troubleshooting/tracing this?

I'm running Drupal 9.3.3.

1 Answer 1

0

Contrary to what I had initially thought, this was coming from a template. In this case, the field__node__title.html.twig file was adding these but it was only displaying in certain cases due to the theme. This was resolved by making this template more specific. Thanks to the Drupal Slack channel for helping bounce some ideas!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.