第三级菜单不显示 - TYPO3

时间:2017-10-02 09:59:51

标签: templates typo3 typoscript

我是一名TYPO3新手,我尝试创建一个3级菜单。第3级不显示。这是我使用的TypoScript:

temp.navigation = HMENU
temp.navigation {       
    1 = TMENU
    1 {
        expAll = 1
        NO.allWrap = <li>|</li>
        ACT = 1
        ACT.wrapItemAndSub = <li class="active">|</li>
        IFSUB = 1
        IFSUB.wrapItemAndSub = <li class="expand_menu dropdown">|</li>
        ACTIFSUB = 1
        ACTIFSUB.wrapItemAndSub = <li class="expand_menu dropdown">|</li>
        wrap = <ul class="nav navbar-nav">|</ul>
    }
    2 = TMENU
    2 {
        NO = 1
        NO.allWrap = <div class="col-lg-3"><div class="align-items">|</div></div>
        ACT = 1
        ACT.wrapItemAndSub = <div class="col-lg-3"><div class="align-items">|</div></div>
        IFSUB = 1
        IFSUB.wrapItemAndSub = <div class="col-lg-3"><div class="align-items test12345">|</div></div>
        IFSUB.ATagParams = class="dropdown-toogle" data-toogle="dropdown"
        ACTIFSUB = 1
        ACTIFSUB.wrapItemAndSub = <div class="col-lg-3"><div class="align-items">|</div></div>
        ACTIFSUB.ATagTitle.field = abstract // description // title
        wrap = <a class="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" href="#"></a><div class="row submenu_row"><div class="col-lg-10 col-lg-offset-2"><div class="row submenu">|</div></div></div>
    }
    3 = TMENU
    3 {
        N0 = 1
        NO.allWrap = <li>|</li>
        ACT = 1
        ACT.wrapItemAndSub = <li class="active">|</li>
        ACT.ATagTitle.field = abstract // description // title
        wrap = <ul class="sub_menu">|</ul>
    }
}

2 个答案:

答案 0 :(得分:2)

请尝试将expAll = 1添加到第二级菜单中。

答案 1 :(得分:0)

试试这个:

temp.navigation = HMENU
temp.navigation {   
    1 = TMENU
    1 {
        expAll = 1
        wrap = <ul class="nav navbar-nav">|</ul>
        NO = 1
        NO {
            wrapItemAndSub = <li>|</li>
        }
        ACT < .NO
        ACT {
            wrapItemAndSub = <li class="active">|</li>
        }
        IFSUB < .NO
        IFSUB {
            wrapItemAndSub = <li class="expand_menu dropdown">|</li>
        }
        ACTIFSUB  < .NO
        ACTIFSUB {
            wrapItemAndSub = <li class="expand_menu dropdown">|</li>
        }
    }
    2 < temp.navigation.1
    2 {
        wrap = <a class="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" href="#"></a><div class="row submenu_row"><div class="col-lg-10 col-lg-offset-2"><div class="row submenu">|</div></div></div>
        NO.wrapItemAndSub = <div class="col-lg-3"><div class="align-items">|</div></div>
        ACT.wrapItemAndSub = <div class="col-lg-3"><div class="align-items">|</div></div>
        IFSUB.wrapItemAndSub = <div class="col-lg-3"><div class="align-items test12345">|</div></div>
        IFSUB.ATagParams = class="dropdown-toogle" data-toogle="dropdown"
        ACTIFSUB.wrapItemAndSub = <div class="col-lg-3"><div class="align-items">|</div></div>
        ACTIFSUB.ATagTitle.field = abstract // description // title
    }
    3 < temp.navigation.1
    3 {
        wrap = <ul class="sub_menu">|</ul>
        NO. wrapItemAndSub = <li>|</li>
        ACT.wrapItemAndSub = <li class="active">|</li>
        ACT.ATagTitle.field = abstract // description // title
    }
}

您的包装输出是奇怪的HTML,用于导航为UL。有效和可访问菜单的结果必须如下:

<ul class="nav-level1">
    <li><a href="...">ItemLevel1</a></li>
    <li><a href="...">ItemLevel1</a></li>
    <li><a href="...">ItemLevel1</a>
        <ul class="nav-level2">
            <li><a href="...">ItemLevel2</a></li>
            <li><a href="...">ItemLevel2</a></li>
            <li><a href="...">ItemLevel2</a></li>
        </ul>
    </li>
    <li><a href="...">ItemLevel1</a></li>
</ul>