Score:0

Frontpage title outputs a node's title and ADDS quotation marks

in flag

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.

Score:0
in flag

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!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.