簡體   English   中英

一頁上的TYPO3內容按頁面樹中的位置排序

[英]TYPO3 content on one page order by position in pagetree

我正在一頁顯示子頁面中的所有內容:

lib.allPid = COA
lib.allPid {
    10 = HMENU
    10 {
        #entryLevel = 1
                special = directory
                special.value = 115
        1 = TMENU
        1 {
            expAll = 1
            NO.doNotShowLink = 1
            NO.allStdWrap.field = uid
            NO.allStdWrap.wrap = |,
        }
        2 < .1
    }
}

lib.allContent = CONTENT
lib.allContent {
    table = tt_content
    select {
        pidInList.cObject < lib.allPid
                where = colPos = 0
                orderBy = pid DESC
    }
}

在這里,內容按pid DESC排序。 但我想按子頁面在頁面樹中的位置來排序內容。 這樣用戶可以定義自己的順序。

我試過了:

lib.allContent = CONTENT
lib.allContent {
  table = tt_content
  select {
    pidInList.cObject < lib.allPid
    leftjoin = pages ON (tt_content.pid = pages.pid)
                where = tt_content.colPos = 0                    
                orderBy = pages.sorting ASC
  }
}

沒工作...

有誰知道如何做到這一點? 提前致謝!

您的方法不錯,但是您使連接出錯。

在您的代碼中,它是tt_content.pid = pages.pid ,這是錯誤的。 tt_contentpid值是pagesuid

您需要更改腳本,以便:

lib.allContent = CONTENT
lib.allContent {
  table = tt_content
  select {
    pidInList.cObject < lib.allPid
    leftjoin = pages ON (tt_content.pid = pages.uid)
                where = tt_content.colPos = 0                    
                orderBy = pages.sorting ASC
  }
}

我對其進行了測試,並且它可以在測試實例上運行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM