Here first time means when user view default english version then linking works well but when user view spanish version then linking goes wrong .Here english display link for spanish and spanish display link for default domain url with /es appended at the end not whole page url ..is anybody have any answer?
Hi Is it possible to have a statement in my language switcher module so that only if there is a translated page in that language available to display that language option in the switcher, if not don't display that language option in the dropdown?
août 9, 20188:29 AM - modifié août 10, 20189:35 AM
How to create a custom language switcher in HubL?
Hi, thanks for the tip.
However, I did notice something strange while trying it out:
I re-created the example from the video and unfortunately it doesn't work that easily (at least in our test portal).
Here's the problem:
If the "Enable Language Specific Redirects" function is activated in the settings, the URL of the translated language version is linked correctly. However, the URL addition "?hsLang=de" ensures that a visitor cannot change the language, because he is always redirected to the current language.
If this function is deactivated, the output of the URL of the translated version works as text, but not as a link target.
However, if you give the link the class "lang_switcher_link" from the standard language switcher module, the correct target URL is linked.
Hover: Link to english versionHover: Link to french version
Or you simply add the class "hs-skip-lang-url-rewrite" on a parent or child-element. Which deactivates the automatic Language Specific Redirects on your Language-Switcher-Links.
With this class, the target url is linked correctly, too – no matter if the setting is activated or not.