0

我有一个包含两列的网站(colPos = 0 和 colPos = 2)。我怎样才能将第 2 列的标题包含到部分索引中?默认行为是仅包含第 0 列的标题。

更具体地说,这是我用来生成菜单的 TypoScript:

lib.menupage = HMENU
lib.menupage {
  1 = TMENU
  1 {
    wrap = <ul> | </ul>
    NO.wrapItemAndSub = <li> | </li>
    sectionIndex = 1
  }
}

我正在使用 TYPO3 6.0。

4

2 回答 2

2

我猜你正在寻找

lib.menupage.1.sectionIndex.useColPos = -1

但这似乎只在 TYPO3 6.0 中可用

作为一种解决方法,应该可以自己完成。呈现一个普通菜单,但使用 CONTENT 对象覆盖(allWrap.cObject 应该完成这项工作)链接,该对象从该页面的 tt_content 检索所有标题。这是一些伪代码,有助于解释我将如何尝试解决该问题。这段代码行不通,只是说明原理:

lib.menupage = HMENU
lib.menupage {
  1 = TMENU
  1 {
    wrap = <ul> | </ul>
    NO.wrapItemAndSub = <li> | </li>
    # pgampe suggested to use: stdWrap2.append instead of allWrap.cObject. My intention
    # was to override the original link at all. But you should be able to play with
    # the different stdWrap functions to get the best solution
    # as far as i remember, allWrap will be wrapped by "wrapItemAndSub"
    NO.allWrap.cObject = CONTENT
    NO.allWrap.cObject {
       table = tt_content
       select {
         # the uid is the id of the page where we need the content from
         pidInList.field = uid
         orderBy = colPos, sorting
       }
       # inside the renderobj we get the elements which are retrieved by CONTENT
       renderObj = TEXT
       renderObj {
         field = header
         typolink.parameter.field = pid
         typolink.section.field = uid
         required = 1
         wrap = <span class="inside-li">|</span>
       }
    }
  }
}
于 2012-12-28T18:18:45.970 回答
0

您很可能正在寻找section index.menu content object

渲染定义在tt_content.menu.20.3.stdWrap.prepend.20 = CONTENT. 您可以使用TSOB (TypoScript Object Browser)来调查相关typoscript设置。

您可以像CONTENTTYPO3 中的任何对象一样根据需要对其进行调整。但是它应该已经选择了任何列(至少在 6.0 中)。

于 2012-12-14T18:16:03.637 回答