0

我正在尝试设置浏览菜单来循环页面及其子页面。我必须采用< 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>

  }
}

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

4

2 回答 2

2

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

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
        }
    }
}
于 2017-06-08T11:16:51.427 回答
0

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

    #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>

}

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

于 2012-08-24T11:32:42.387 回答