错误导航3

时间:2014-04-10 14:17:59

标签: templates typo3

我的导航输出,见下文:

<div id="main_nav">

    <ul class="mainnav">
        <li>
            <a class="navlink_0" onfocus="blurLink(this);" href="top.html"></a>
        </li>
    </ul>
    <ul class="mainnav">
        <li>
            <a class="navlink_1" onfocus="blurLink(this);" href="sub1.html"></a>
        </li>
    </ul>
    <ul class="mainnav">
        <li>
            <a class="navlink2_0" onfocus="blurLink(this);" href="sub2_1.html"></a>
        </li>
    </ul>
    <ul class="mainnav">
        <li>
            <a class="navlink2_0" onfocus="blurLink(this);" href="sub2_2.html"></a>
        </li>
    </ul>
</div>

我在模板中的导航:

page.10 {   
   subparts {
    main_nav = HMENU
     main_nav {
       entryLevel = 0
       1 = TMENU
       1.NO = 1
       1.NO.linkWrap = <ul class="mainnav"><li>|</li></ul>
       1.NO.ATagParams = class="navlink_0"

       1.CUR = 1
       1.CUR < subparts.main_nav.1.NO
       1.CUR.linkWrap = <ul class="mainnav"><li>|</li></ul>
       1.CUR.ATagParams = class="navlink_1"
       1.CUR.doNotLinkIt = 0

       1.ACTIFSUB= 1
       1.ACTIFSUB< subparts.main_nav.1.NO
       1.ACTIFSUB.linkWrap = <ul class="mainnav"><li>|</li></ul>
       1.ACTIFSUB.ATagParams = class="navlink_1"
       1.ACTIFSUB.doNotLinkIt = 0


       2 = TMENU
       2.NO = 1
       2.NO.allWrap = <ul class="mainnav"><li>|</li></ul>
       2.NO.ATagParams = class="navlink2_0"

       2.CUR = 1
       2.CUR < subparts.subnav.1.NO
       2.CUR.allWrap = <ul class="mainnav"><li>|</li></ul>
       2.CUR.ATagParams = class="navlink2_1"
       2.CUR.doNotLinkIt = 0

       2.ACTIFSUB= 1
       2.ACTIFSUB< subparts.subnav.1.NO
       2.ACTIFSUB.allWrap = <ul class="mainnav"><li>|</li></ul>
       2.ACTIFSUB.ATagParams = class="navlink2_1"
       1.ACTIFSUB.doNotLinkIt = 0
       }
          }    
}

这就是我想要的:

<div id="main_nav">

    <ul class="mainnav">
        <li>
            <a class="navlink_0" onfocus="blurLink(this);" href="top.html"></a>
        </li>
    </ul>
    <ul class="mainnav">
        <li>
            <a class="navlink_1" onfocus="blurLink(this);" href="sub1.html"></a>
        </li>
    </ul>
    <ul id="submenu" class="subsubmenu">
        <li>
            <a class="navlink2_0" onfocus="blurLink(this);" href="sub2_1.html"></a>
        </li>
        <li>
            <a class="navlink2_0" onfocus="blurLink(this);" href="sub2_2.html"></a>
        </li>
    </ul>

</div>

或者显示它:

top1 | top2 | top2 ....
sub1 | sub2 | sub3 ....
       (eg)
     sub2_1
     sub2_2
     ...

我在TYPO3的模板文件中需要做什么?对不起,我是TYPO3的新手,很复杂。

1 个答案:

答案 0 :(得分:0)

实际上我认为你的目标代码在语义上并不正确。 它应该是:

<div id="main_nav">

    <ul class="mainnav">
        <li>
            <a class="navlink_0" onfocus="blurLink(this);" href="top.html"></a>
        </li>
    </ul>
    <ul class="mainnav">
        <li>
            <a class="navlink_1" onfocus="blurLink(this);" href="sub1.html"></a>
            <ul id="submenu" class="subsubmenu">
            <li>
            <a class="navlink2_0" onfocus="blurLink(this);" href="sub2_1.html"></a>
            </li>
            <li>
            <a class="navlink2_0" onfocus="blurLink(this);" href="sub2_2.html"></a>
        </li>
    </ul>
        </li>
    </ul>
</div>

这是你用IFSUB实现的。 请参阅此处的示例:http://www.typo3wizard.com/de/snippets/menus/text-menu-tmenu.html 在这里:Typoscript navigation with subpages