TS配置typo3的菜单可以表现为直接展开子菜单,或者onClick菜单项时显示子菜单.
onClick时展开子菜单的TS示例如下:
######### SUB Menu #########################
temp.subnav = HMENU
temp.subnav{
  entryLevel = 1
  1=TMENU
  1 {
     #expAll = 1  
     wrap = <ul id="menuTree">|</ul><span></span>
     NO.wrapItemAndSub = <li>|</li>
     NO.stdWrap.htmlSpecialChars = 1
     ACT < .NO
     ACT = 1
     ACT.ATagParams = class="current"
  }
  2 = TMENU
  2{
     expAll = 1  
     wrap = <ul id="submenuTree">|</ul><span></span>
     NO.allWrap = <li>|</li>
     NO.stdWrap.htmlSpecialChars = 1
     ACT < .NO
     ACT = 1
     ACT.ATagParams = class="current"
     #IFSUB < .NO
     #IFSUB =1
     #IFSUB.expAll = 1  
  }
}
ts_sub_menu = COA
ts_sub_menu.10 < temp.subnav
#####################################################
直接展开所有显示子菜单的TS----只需要将上面的TS中的所有被注销的行不注销.
关键词:expAll
expAll值为布尔变量.官方文档对它的解释如下:If this is true, the menu will always show the menu on the level underneath the menuitem. This corresponds to a situation where a user has clicked a menuitem and the menu folds out the next level. This can enable that to happen on all items as default.
 


若转载请注明出处: TYPO3中文网
本文地址: http://www.51typo3.cn/faq/84.html