Bug #48300
closed
Entrylevel wrong when switching languages
Added by Florian Scholz over 11 years ago.
Updated about 6 years ago.
Description
In a multi-language setup, I get different entrylevel outputs when switching from the default language (German) to another language (English)
Defined value is entrylevel = 1, however the English version behaves like there would have been set entrylevel = 0 in the TypoScript.
Any ideas?
Language settings:
config {
linkVars = L
htmlTag_langKey = de_DE
sys_language_uid = 0
language = de
locale_all = de_DE
sys_language_overlay = 1
}
// Language Englisch
[globalVar = GP:L = 1]
config.linkVars = L
config.sys_language_uid = 1
config.language = en
config.locale_all = en_GB
config.htmlTag_langKey = en_GB
[global]
Menu TypoScript:
SUBNAVI = COA_INT
SUBNAVI = HMENU
SUBNAVI {
entryLevel = 1
1 = TMENU
1 {
wrap = <ul class="subMnu">|</ul>
noBlur = 0
NO = 1
NO.wrapItemAndSub = <li class="subMnuSingleBlue">|</li>
CUR < .NO
CUR.ATagParams = class="act"
IFSUB = 1
IFSUB.wrapItemAndSub = <li class="subMnuBlue">|</li>
CURIFSUB < .IFSUB
CURIFSUB.ATagParams = class="act"
ACT = 1
ACT < .NO
ACTIFSUB < .CURIFSUB
}
2 = TMENU
2 {
wrap = <ul class="subMnu">|</ul>
NO = 1
NO.wrapItemAndSub = <li class ="subMnuGrey">|</li>
CUR < .NO
CUR.ATagParams = class="act"
ACT = 1
ACT < .CUR
}
}
(c.f. http://www.typo3.net/forum/beitraege/mehrsprachigkeit/114479/)
Files
- Status changed from New to Needs Feedback
Are you sure that you created translations for all pages?
I can not reproduce this. Please share more details, best would be an export of a sample page tree including the TS.
same issue.
when i increment the entryLevel within a condition to the language(!=0), everything works like expected.
i also disabled the realurl-extension to exclude this. i will create an sample export next days...
the range of "special = rootline" also starts at the wrong point.
i defined a page with "is_siteroot", but in a other language as default, it is ignored.
I think i found the Problem in
\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::updateRootLinesWithTranslations()
In this method the rootline of the template is overwritten which look pretty dirty to me:
$this->tmpl->rootLine = array_reverse($this->sys_page->getRootLine($this->id, $this->MP));
The rootline of the template should be initialized by passing it to the start()
method of the TemplateService
(\TYPO3\CMS\Core\TypoScript\TemplateService::start($theRootLine)
). Otherwise configuration options like "root" of the template are totally ignored.
The change was commited with 51f41665 and reviewed here: https://review.typo3.org/#/c/16992/
To test the problem you have two options:
- use
config.sys_language_mode = content_fallback; 0
- add a language record to the sub root page
I attach a small page tree export where you can test the problem:
- in the TYPO3 root create a "Alternative Page Language" record (e.g. English) with UID 2
- import the
t3d
file
- navigate to page subroot1 - page 1.1 (has a language record)
- append
&L=2
to URL
Expected behavior: The menu structure should not change
Current behavior: The menu is now linking to the root pages.
- Status changed from Needs Feedback to Under Review
Can we please have this in a 6.1.x release? I consider this as a major bug.
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF