我在TypoScript中创建了一个菜单,在该菜单的下拉部分中有子页面列表和新闻列表。菜单的代码可以正常工作,但是它在每个子页面(subpage1和新闻列表,subpage 2和新闻列表...等)之后呈现新闻列表。我想拥有两个独立的元素(一个子页面列表和一个新闻列表),但是我不知道该如何实现?
这是我的菜单代码:
lib.header_main-menu = COA
lib.header_main-menu {
10 = HMENU
10 {
wrap = <ul class="nav navbar-nav">|</ul>
entryLevel = 0
1 = TMENU
1 {
noBlur = 1
wrap = |
expAll = 1
NO = 1
NO {
ATagTitle.field = title
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
}
}
2 = TMENU
2 {
expAll = 1
wrap = <div class="subnav-wrapper"><ul class="subnav">|</ul></div>
NO = 1
NO {
wrapItemAndSub = <li>|</li>
wrapItemAndSub.append = COA
wrapItemAndSub.append {
wrap = |
10 = CONTENT
10 < lib.header_menu_news
}
}
}
}
lib.header_main-menu = COA
lib.header_main-menu {
wrap = <div>|</div>
// this is section 10 of the COA
10 = HMENU
10 {
wrap = <ul class="nav navbar-nav">|</ul>
entryLevel = 0
1 = TMENU
1 {
noBlur = 1
wrap = |
expAll = 1
NO = 1
NO {
ATagTitle.field = title
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
}
}
2 = TMENU
2 {
expAll = 1
wrap = <div class="subnav-wrapper"><ul class="subnav">|</ul></div>
NO = 1
NO {
wrapItemAndSub = <li>|</li>
}
}
}
// this is section 20 of the COA
// btw the next line isn't necessary, you do that (define the object type) in lib.header_menu_news already
// 10 (would be 20 now) = CONTENT
20 < lib.header_menu_news
20.wrap = <h3>News</h3>|
}
实际上,这等同于将它们分别放入模板中
<div>###MENU###
<h3>News</h3>
###NEWSMENU###</div>
顺便说一句,除非您在后端的某个地方使用lib.object,否则我将使用temp。相反-后者在构建页面对象后未设置,我猜测这可能会更好地提高性能。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句