TYPO3 菜单:如何设置“entryLevel"动态的? [英] TYPO3 menu: how to set "entryLevel" dynamic?
问题描述
我正在尝试创建一个菜单,在 TYPO3 中显示所有子页面和父页面.我的问题是我找不到动态分配 entryLevel
的方法.
I'm trying to create a menu that displays in TYPO3 all subpages and the parent page. My problem is that I find no way to assign entryLevel
dynamically.
我正在使用 TYPO3 6.1
这是目前我的菜单打字稿.
I'm working with TYPO3 6.1
This is currently my typoscript for the menu.
lib.mainnavi = HMENU
lib.mainnavi {
entryLevel = 1
1 = TMENU
1.wrap = <ul> | </ul>
1 {
noBlur = 1
NO {
subst_elementUid = 1
allWrap = <li id="link{elementUid}" class="first">| |*| <li id="link{elementUid}">| |*| <li id="link{elementUid}" class="last">|
wrapItemAndSub = |</li>
}
ACT = 1
ACT {
subst_elementUid = 1
allWrap = <li id="link{elementUid}" class="first current first_current">| |*| <li id="link{elementUid}" class="current">| |*| <li id="link{elementUid}" class="last current last_current">|
wrapItemAndSub = |</li>
}
}
}
下面是一张图片来说明我想要什么.
当我转到1"时,我想查看FAQ"、GTC(欧盟)"和GTC(美国)".
当我转到常见问题解答"时,我希望将 A-J 和1"视为返回".
当我转到A"时,我希望将FAQ"视为返回"
Below is a picture to illustrate what I want.
When I go to "1", I want to see "FAQ", "GTC (EU)" and "GTC (USA)".
When I go to "FAQ", I want to see A-J and "1" as "back".
When I go to "A", I want to see "FAQ" as "back"
我可以使用第二个菜单和 special = browse
制作后退"菜单.但是我找不到动态设置 entryLevel
的方法
I can make the "back" menu with a seccond menu and special = browse
. But I can't find a way to set entryLevel
dynamically
推荐答案
入门级可以得到正负值.
Entry level can get positive and negative values.
正值表示从根页面开始计数的绝对级别位置.
While the positive values are marking absolute level positions counting from the root page.
Root => 0
- Page => 1
- Page => 2
- Current Page => 3
负值将是相对的,并从当前页面返回到根目录
negative values will be relative and counted from the current page back to the root
Root => -4
- Page => -3
-Page => -2
- Current Page => -1
这样您就不必为每个级别都使用条件,这只会使您的缓存表膨胀.
This way you don't have to use conditions for every level, which would just bloat your caching tables.
Root => 0
- Page => 1
- Current Page => 2
Root => -3
- Page => -2
- Current Page => -1
这篇关于TYPO3 菜单:如何设置“entryLevel"动态的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!