如何设置浏览菜单以循环页面及其子页面仅在拼写错误3?

时间:2012-08-23 09:09:34

标签: typo3 typoscript

我正在尝试设置浏览菜单以循环页面及其子页面。我必须以<的形式提供它2> ,其中< 是上一页, 2 是当前页面,> 是下一页。为了重新解决这个问题,我决定在父页面上放置一个扩展模板,浏览菜单指向子页面树的第一页:

lib.pagenumber = HMENU
lib.pagenumber{
  special = browse
  special.items = | next
  special.next.uid = 100
  special.next.fields.title = 2

  1 = TMENU
  1{
     noBlur = 1
     expAll = 0
     NO = 1
     NO.ATagTitle = 1
     NO.before = <div id="currLGMpg" class= "currpg">1</div>
     NO.linkWrap = <div class=nextLGMpg>|</div>

  }
}

当前页面没有链接,只是一个图像框,它必须位于prev和next链接之间,并且也是自动编号的。这是我要解决的第二个问题。 对于子页面,我认为第一个子页面上的模板和linkwrap上的选项拆分可以用于设置prev和next链接的样式,但我不知道如何将当前页面的图像放在中间。

2 个答案:

答案 0 :(得分:0)

所以我终于解决了所有问题。这是自动为页面编号。对于那些感兴趣的人,你需要分别映射下一个和prev,以便你可以在其间放置一个页码按钮。以下typoscript代码位于要设置浏览按钮的页面的根页树上:

    #Next page button setup
lib.nextpage = HMENU
lib.nextpage.special = browse
lib.nextpage.special.items = next

#can't remove the page title some reason it just gets inserted back so we set it to nothing
lib.nextpage.special.next.fields.title =

#if we're on the parent page of the page tree we wish to browse next should point to the first page of the subtree.
[globalVar = TSFE:id = 46]
  lib.nextpage.special.next.uid = 100
[global]  

lib.nextpage.1 = TMENU
lib.nextpage.1{
     noBlur = 1
     expAll = 0
     NO = 1
     #NO.ATagTitle = 1
     NO.linkWrap = <div class=nextLGMpg>|</div>

}

#Page number
lib.currpage = TEXT
#can't autonumber yet so put a 1 as a placeholder for the current page number 
lib.currpage.value = 1 
lib.currpage.wrap = <div id="currLGMpg">|</div>

#previous page button setup

#copy from next page setup; tbh all we gain is 1 less line code
lib.prevpage < lib.nextpage
lib.prevpage.special.items = prev
lib.prevpage.special.prev.fields.title =
#again if we're at the 1st subpage we need to target the parent page as that is page one.
[globalVar = TSFE:id = 100]
  lib.prevpage.special.prev.uid = 46
#next line tests to see if we're at page 1. If we are we remove the prev object because browsing stops here.
[globalVar = TSFE:id = 46]
lib.prevpage >
[global]

lib.prevpage.1 = TMENU
lib.prevpage.1{
     noBlur = 1
     expAll = 0
     NO = 1
     #NO.ATagTitle = 1
     NO.linkWrap = <div class=prevLGMpg>|</div>

}

一旦我弄清楚如何自动编号,我会更新答案。

答案 1 :(得分:0)

你好骑自行车你应该遵循以下步骤,这只适用于下一步请按照相同的步骤进行。

temp.lightbox_navi.30 = HMENU
temp.lightbox_navi.30 {
    stdWrap.wrap = <li>|</li>
    special = browse
    special {
        items = next
        items.prevnextToSection = 0
        next.fields.title = < next Projekt
    }
    1 = TMENU
    1 {
        NO = 1
    }
    stdWrap.ifEmpty.cObject = HMENU
    stdWrap.ifEmpty.cObject {
        special = browse
        special {
            items = first
            items.prevnextToSection = 0
            first.fields.title = < next Projekt o
        }
        1 = TMENU
        1 {
            NO = 1
        }
    }
}