BUGFIX: Language fallback handling for canonical and alternate language links#154
BUGFIX: Language fallback handling for canonical and alternate language links#154
Conversation
|
Thanks for fixing this issue! This is nevertheless a breaking change which could impact many websites to the negative.
What we are trying to handle might actually be quite an edge case... |
regniets
left a comment
There was a problem hiding this comment.
Code is fine, but see my comment on use case.
|
I disagree that it's an edge case. Actually most projects I'm involved with which use multiple languages use fallbacks to completely different languages. Most of the time everything falls back to English and the customers want to have a full page tree in all languages as they don't know when they are able to localise everything. I also don't really see the negative SEO effect. Why should the UK version when it's not localised have its own canonical and language link? If this is really required to be defined on a per preset basis we might need additional options in the presets or in the SEO settings. |
|
Got it - and good to know there are many websites that will benefit (so will neos.io)! But we are introducing something that will have an effect on many websites that are using this package Flagging derivates is a main use case of hreflang. When i have a website for Austria (.at) that shares most of the content with the german version (.de) but has different products, i would want the austrian user to find austrian results (de-at). |
|
So you mean regarding the canonical and alternate language links the new behaviour should be behind a feature flag, which we might inverse with a major release? |
|
I'm not into SEO that much (I just know that duplicate content is bad) so I can't really vote on this change. But from my own experience I can tell that breaking changes in this package can be very harmful because they can be quite subtle. When I updated a large project recently it introduced a different set of metatags leading to a downgrade on Google. |
|
@Sebobo - i think a feature flag might be the best solution. |
|
A customer of mine required the same fix today for a project with many languages and 2 dimensions. |
kdambekalns
left a comment
There was a problem hiding this comment.
[…] and will finish up this PR when they are happy with it.
Any news?
|
indeed, got a customer project as well now that could need the fix :) |
Without this change untranslated pages have canonicals to themselves instead of their fallback node if set.
2d8fd9b to
08f5fd5
Compare
Yes, I updated the PR, as I just needed the patch again 😄 |
|
This will need a separate implementation for Neos 9, as I just had the some of the problems yet again on neos.io. |
The canonical link will now link to the original node if a dimension fallback is active.
The list of alternate language links will not contain nodes anymore if they don't exist in the target language.
Also the
langattribute of the html tag is now correct when a fallback is shown.All three issues can be tested by browsing to
/ukin the Neos.Demo.langshould been_US, canonical should link to it to and no alternate language link for uk should exist.