[英]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_content
的pid
值是pages
的uid
。
您需要更改腳本,以便:
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.