本文介绍了当活动菜单项有子菜单时更改 TMENU 的换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果当前活动菜单项有子菜单 (ACTIFSUB
),我想更改 TMENU
的 wrap
.
I want to change the wrap
of a TMENU
if the current active menu item has a submenu (ACTIFSUB
).
以下是我的打字稿摘录:
Below is a excerpt of my typoscript:
lib.navigation = HMENU
lib.navigation {
1 = TMENU
1 {
wrap = <ul class="m-navigation-list">|</ul>
# if the current active menu item has a submenu, change the wrap to this:
# wrap = <ul class="m-navigation-list m-navigation-list--parent">|</ul>
ACTIFSUB = 1
ACTIFSUB {
wrapItemAndSub = <li class="m-navigation-item m-navigation-link--parent m-navigation-link--ladder">|</li>
# overwrite the wrap of the TMENU?
}
}
推荐答案
小心,如果启用 expAll,将始终打印子菜单,因此将始终使用覆盖.
Be careful as if you enable expAll, submenus will be always printed and as consequence override will be always used.
这是工作示例:
lib.navigation = HMENU
lib.navigation {
wrap = <ul>|</ul>
wrap.override = <ul class="override">|</ul>
entryLevel = 0
1 = TMENU
1 {
expAll = 0
NO.allWrap = <li> | </li>
ACT = 1
ACT.allWrap = <li>|</li>
ACTIFSUB = 1
ACTIFSUB {
allWrap= <li class="sub">|</li>
before.cObject = LOAD_REGISTER
before.cObject.actsubmenu = TEXT
before.cObject.actsubmenu.value = 1
}
}
wrap.override.if.isTrue.data = REGISTER:actsubmenu
}
这篇关于当活动菜单项有子菜单时更改 TMENU 的换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!