On a site we maintain the hreflang meta tags are not showing on the page, even though if I check at the end of the foreach() loop in hreflang_page_build() I can see that tags are being submitted via drupal_add_html_head().

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB

This changes to using an #attached structure to output the tags.

Status: Needs review » Needs work

The last submitted patch, 2: hreflang-n2596569-2.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new867 bytes

Rerolled.

damienmckenna’s picture

This brings up the problem that Metatag had to deal with - what if there's no 'content' region? How about this - a variable to let site builders change which region is used.

damienmckenna’s picture

StatusFileSize
new2.57 KB

Oh yeah, the file.

mfb’s picture

What themes have this issue? I didn't know it's possible for hook_page_build() to get called too late.

damienmckenna’s picture

It's a subtheme of a subtheme of Omega 4. I haven't dug into it to see why the problem exists.

mfb’s picture

Status: Needs review » Postponed (maintainer needs more info)

I made a subtheme of a subtheme of Omega 4.4 and hreflang tags were still there. So it'd be nice to dig in and confirm this isn't a bug in the particular theme.

visios’s picture

Hello,

I'm encountering the problem that the hreflang for the current language is not outputted. Only the other language version(s) (I only have 2 languages running, german and english) are shown.

I can confirm that using omega 4 theme with a sub theme is causing this problem. Another site with Omega 4 and no sub theme is working fine. When I switch theme to e.g. Seven the two hreflang tags are shown correctly. The Omega 4 sub theme is using a ' content' region.

Can anybody give some advice how to tackle this problem? Thanks!

visios’s picture

Turns out I was unsetting $links[$language->language] in my template. Now all links are back.

howdytom’s picture

I am experiencing the same issue with paragraphs 7.x-1.0-rc5 contrib module. hreflang meta tags doesn’t not show !?

mfb’s picture

You'll have to provide steps to reproduce your issue.

mfb’s picture

I need more info on how to reproduce this - ideally something we could write a test for, or a minimal custom theme that I can use to reproduce it locally.

mfb’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)