我有一个包含两列的网站(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。
答案 0 :(得分:2)
我猜你正在寻找
lib.menupage.1.sectionIndex.useColPos = -1
(But this seems to be only available in TYPO3 6.0)
作为一种解决方法,应该可以自己完成。渲染一个普通的菜单,但覆盖(allWrap.cObject应该完成工作)与CONTENT对象的链接,该对象从该页面的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>
}
}
}
}
答案 1 :(得分:0)
您最有可能在section index
中找到menu content object
功能。
渲染在tt_content.menu.20.3.stdWrap.prepend.20 = CONTENT
中定义。您可以使用TSOB (TypoScript Object Browser)
调查相关的typoscript
设置。
您可以根据需要调整它,就像TYPO3中的任何CONTENT
对象一样。但是它应该已经选择了任何列(至少在6.0中)。