TYPO3生成子页面/级别2的链接菜单

时间:2013-10-17 12:23:26

标签: menu typo3 typoscript

如果我有这个代码,我可以生成一个链接菜单。并说我只想包括Uid 4和8。

lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
  wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
  expAll = 0
  NO = 1
  NO.allWrap = <li>|</li>
  NO.stdWrap.wrap = <span>|</span>
  RO < .NO
  RO = 1
  CUR < .NO
  CUR = 1
  CUR.allWrap = <li class="current">|</li>
  CUR.stdWrap.wrap = <span>|</span>
  CUR.ATagParams =  
  ACT < .CUR
} 

我现在的问题是..

我怎么说我想从Uid 4下的子页面生成一个链接菜单,所以它不显示Uid 4的链接,而是这个Uid下的3-5个子页面?

.. .. UPDATE

好的,我现在有了这个代码,而且几乎可以。

lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 5
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
    wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
    expAll = 1
    NO = 1
    NO.allWrap = <li>|</li>
    NO.stdWrap.wrap = <span>|</span>
    NO.doNotShowLink = 0
    NO.doNotShowLink.stdWrap.override = 1
    NO.doNotShowLink.stdWrap.if {
        equals.field = uid
        value = 5
    }
    RO < .NO
    RO = 1
    CUR < .NO
    CUR = 1
    CUR.allWrap = <li class="current">|</li>
    CUR.stdWrap.wrap = <span>|</span>
    CUR.ATagParams =
    ACT < .CUR
}
lib.prodNavi.2 < lib.prodNavi.1

但它向我展示橙色盒子,几乎就像它使用Wrap 2次一样。 2 times wrapper

我如何只用这样一个包装来展示它。

one wrapper

1 个答案:

答案 0 :(得分:0)

您可以使用doNotShowLink = 1隐藏菜单项。并且您可以使用stdWrap.override隐藏单个项目。

在这里你将展示uid 8以及uid 4的子页面和子页面.uid 4本身不会显示

lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
    wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
    expAll = 1
    NO = 1
    NO.allWrap = <li>|</li>
    NO.stdWrap.wrap = <span>|</span>
    NO.doNotShowLink = 0
    NO.doNotShowLink.stdWrap.override = 1
    NO.doNotShowLink.stdWrap.if {
        equals.field = uid
        value = 4
    }
    RO < .NO
    RO = 1
    CUR < .NO
    CUR = 1
    CUR.allWrap = <li class="current">|</li>
    CUR.stdWrap.wrap = <span>|</span>
    CUR.ATagParams =
    ACT < .CUR
}
lib.leftNavi.2 < lib.leftNavi.1

更新:

仅使用包裹一次只用于HMENU,而不是用于TMENU:

lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 252
lib.prodNavi.wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
    expAll = 1
    NO = 1
    NO.allWrap = <li>|</li>
    NO.stdWrap.wrap = <span>|</span>
    NO.doNotShowLink = 0
    ...
}
lib.prodNavi.2 < lib.prodNavi.1