The custom tokens in the hreflang module currently support Entity Translation, they need to also support Content Translation.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

ericdsd’s picture

Hi
subscribing to this need too.

[node:url-fr] doesn't work with content translation,
does someone have a quick workarround that could make it before this issue is addressed ?

Or maybe another module that could do the trick for hreflang only ?

Thanks

jennypanighetti’s picture

Priority: Normal » Major

Does anybody have a solution for this? I get NO output in my translated nodes' metatags for alternate language URLs. This needs to work.

DamienMcKenna’s picture

What needs to be done is metatag_hreflang_tokens() needs to be expanded to handle Content Translations, there isn't really a workaround, someone just needs to take the time to build the changes.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
3.35 KB

Out of interest, does this work for you?

jennypanighetti’s picture

Ooh! Yes, actually, it did fix it!! Wow, thank you!

jennypanighetti’s picture

The only issue I see now (and this is probably a larger issue) is that, it does not take the "Published" status into account. If the English node is published but the British one is not, the English node will output an hreflang for en-gb - even if that content is inaccessible to users.

If this aspect should be moved into its own issue, let me know...

DamienMcKenna’s picture

I'm very happy to hear that it's working for you! You bring up a good point about unpublished content, so lets do it this way.

DamienMcKenna’s picture

jennypanighetti’s picture

Yes, that worked, thank you!

I think your -8 patch is missing one of the checks for $translation->status. See screenshot. I added it into my version and it works well.

-Jenny

  • DamienMcKenna committed 7dcc172 on 7.x-1.x
    Issue #2832101 by DamienMcKenna, jenstechs: hreflang tokens should...
DamienMcKenna’s picture

Status: Needs review » Fixed

Awesome! Committed.

FYI I spun off a separate issue for test coverage.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.