Bug #67085
closed
language menu uses incorrect active state
Added by Stefan M. over 9 years ago.
Updated almost 6 years ago.
Description
I wanted to create the hreflang tags for a website with 3 different languages: de-DE (default language), de-AT, de-CH.
de-AT and de-CH shall show the complete content of de-DE if there is no translation of the page. So I set hidePagesIfNotTranslatedByDefault to false.
I used this TypoScript:
page.headerData.40 = HMENU
page.headerData.40 {
special = language
special.value = 0,1,2
1 = TMENU
1 {
NO = 1
NO {
doNotLinkIt = 1
stdWrap.cObject = TEXT
stdWrap.cObject.value = de-DE || de-AT || de-CH
linkWrap = <link rel="alternate" hreflang="|
after.cObject = TEXT
after.cObject {
stdWrap {
wrap = " href="|" />
typolink {
parameter.data = page:uid
additionalParams = &L=0 || &L=1 || &L=2
returnLast = url
forceAbsoluteUrl = 1
addQueryString = 1
}
}
}
}
ACT = 1
ACT.doNotShowLink = 1
}
}
Now the problem:
If I'm on the e.g. de-CH page without any translation, de-DE is the ACT item.
I checked the language id with GP:L
and it is set to 2. So IMHO de-CH should be ACT and not de-DE.
I hope you understand what I mean.
Damn.. I forgot to set a good issue title.. :)
- Subject changed from language menu to language menu uses incorrect active state
I tested your Typoscript. For me everything works perfectly well. I am unable to reproduce.
Nevertheless in the first moment I thought I was able to reproduce the issue. But then I noticed that my language configuration was not complete. Do you have a complete language configuration similar to this one…
config {
uniqueLinkVars = 1
linkVars := addToList(L(1-3),print)
sys_language_uid = 0
sys_language_overlay = 1
sys_language_overlay = hideNonTranslated
sys_language_mode = content_fallback
#sys_language_mode = strict
language = de
locale_all = de_DE.utf8
htmlTag_langKey = de
}
## AT
[globalVar = GP:L = 1]
config {
sys_language_uid = 1
language = at
locale_all = de_AT.utf8
htmlTag_langKey = at
}
[global]
## CH
[globalVar = GP:L = 2]
config {
sys_language_uid = 2
language = ch
locale_all = de_CH.utf8
htmlTag_langKey = ch
}
[global]
- Status changed from New to Needs Feedback
My configuration looks similar except:
sys_language_overlay = 1
sys_language_overlay = hideNonTranslated
sys_language_mode = content_fallback
So I added those lines of Typoscript.
Now the active state seems to stop working on CH and AT.
On DE the hreflang for DE was removed. On CH and AT all 3 hreflang are shown.
Stefan, is this reproducible on the latest 6.2.15 or the latest 7 master?
On 6.2.15 it's still reproducable. On 7 I couldn't test it yet.
- Status changed from Needs Feedback to New
- Target version set to next-patchlevel
- Category set to TypoScript
- Status changed from New to Needs Feedback
We implemented href-lang inside the new EXT:seo extension in v9, and also overcame the issue with the proper language configuration via Site Handling. Can you check if this issue still exists? Otherwise we'll close the ticket in a few weeks.
- Status changed from Needs Feedback to Closed
- Target version deleted (
next-patchlevel)
No feedback since the last 90 days => closing this issue.
If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one.
Thank you and best regards
Also available in: Atom
PDF