TYPO3 将根页面标记为活动 [英] TYPO3 mark root page as active
问题描述
在我的 TYPO3 6.2.31(我知道...)页面中,我有以下导航排版:
In my TYPO3 6.2.31 (I know...) page I have the following typoscript for the navigation:
NAVIMAIN = HMENU
NAVIMAIN.entryLevel = 0
#NAVIMAIN.excludeUidList =
NAVIMAIN {
1 = TMENU
1 {
expAll = 1
wrap = <ul class="sf-menu">|</ul>
noBlur = 1
NO = 1
NO.ATagTitle.field = title
NO.wrapItemAndSub = <li>|</li>
ACT = 1
ACT.wrapItemAndSub = <li class="active"> |</li>
}
2 = TMENU
2 {
expAll = 1
maxItems = 10
wrap = <div class="sf-mega">|</div>
NO = 1
NO {
ATagTitle.field = title
wrapItemAndSub = <div class="sf-mega-section">|</div>
stdWrap.wrap = |
ATagParams = class="headermega"
stdWrap.htmlSpecialChars = 1
doNotLinkIt = 0
}
}
3 = TMENU
3 {
expAll = 1
maxItems = 20
wrap = <ul>|</ul>
NO = 1
NO {
ATagTitle.field = title
linkWrap = <li>|</li>
}
ACT = 1
ACT {
wrapItemAndSub = <li>|</li>
ATagParams = class="active"
}
}
#4 < .3
}
所有子页面在被点击时都被标记为活动...但根节点不是...所以我也添加了这个:
All sub pages are marked as aktive when they are clicked ... but the root node not ... so I've added this as well:
[globalVar = TSFE:id=1]
NAVIMAIN.alwaysActivePIDlist = 1
[global]
[globalVar = TSFE:id=1]
NAVIMAIN.alwaysActivePIDlist = 60
[global]
但这也没有任何影响.
如何将根节点也标记为活动?
What can I do to mark the root node as active as well?
提前致谢
推荐答案
经过一些 Teamviewer 调查后,我们在 Typoscript 结构中找到了问题的根源.[globalVar]
条件放在 page.20.marks {}
内,但条件必须放在任何嵌套之外.
After some Teamviewer investigations we found the source of the problem in the Typoscript structure. The [globalVar]
condition was placed inside page.20.marks {}
but conditions must be placed outside of any nesting.
将条件移到嵌套之外并更正路径,一切正常.
Moving the condition outside of the nesting and correcting the path, everything worked fine.
[globalVar = TSFE:id=1]
page.20.marks.NAVIMAIN.alwaysActivePIDlist = 60
[global]
正如 Bernd 所说,[page:uid = 1]
也是更好的条件.
As Bernd said, [page:uid = 1]
would be the better condition, too.
这篇关于TYPO3 将根页面标记为活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!