简体   繁体   English

TYPO3菜单中的其他内容元素

[英]Additional content element in TYPO3 menu

I made a menu in TypoScript in which on drop down section I have list of subpages and list of news. 我在TypoScript中做了一个菜单,在下拉菜单中,我有子页面列表和新闻列表。 The code of menu is working but it render the list of news after every subpage (subpage1 and list of news, subpage 2 and list of news... etc). 菜单的代码正常工作,但是在每个子页面(subpage1和新闻列表,subpage 2和新闻列表...等)之后呈现新闻列表。 I would like to have two independent element (one list of subpages and one list of news), but i don't know how to achieve that? 我想拥有两个独立的元素(一个子页面列表和一个新闻列表),但是我不知道该如何实现?

here is my menu code: 这是我的菜单代码:

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>|
}

actually, this comes to the same as putting them into the template separately 实际上,这等同于将它们分别放入模板中

<div>###MENU###
<h3>News</h3>
###NEWSMENU###</div>

btw unless you use the lib.object in the Backend somewhere, I would use temp. 顺便说一句,除非您在后端的某个地方使用lib.object,否则我将使用temp。 instead - the latter are unset after building the page object, and my guess would be that this might be better for performance. 相反-后者在构建页面对象后未设置,我猜测这可能会更好地提高性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM