0
頁
的相同sys_category使用TYPO3 8.7,我想與當前頁面相同sys_category
在當前頁的頁腳顯示其他頁面的標題。當用戶到達頁面的底部時,他會找到「相關頁面」,這些頁面與當前頁面具有相同的sys_category
。這可以用typoscript完成嗎?我如何獲得其它頁面的標題與當前
我曾嘗試這個代碼,但並沒有工作:關於使用HMENU對象與special = categories
temp.relatedCAT = CONTENT
temp.relatedCAT {
table = pages
select {
// dontCheckPid doesn't exist for CONTENT objects, so make it recursive from root page (or pidInList.data = leveluid:-2
pidInList = {$pidRoot}
recursive = 99
selectFields = sys_category.uid as catUid
join = sys_category_record_mm ON pages.uid = sys_category_record_mm.uid_foreign JOIN sys_category ON sys_category.uid = sys_category_record_mm.uid_local
where = sys_category_record_mm.tablenames = 'pages' AND sys_category_record_mm.uid_foreign = {TSFE:id}
where.insertData = 1
// not necessary for this use case
// orderBy = sys_category.sorting
}
renderObj = TEXT
renderObj {
field = catUid
// Hack: if there are no cats selected for a page, all news are displayed
// so I just pass a catUid that's quite unlikely
wrap = |
}
}
lib.related >
lib.related= TEXT
lib.related {
table = pages
select {
# pid de la racine du site
pidInList = 1
# récursivité jusqu'au maximum de niveau
recursive = 99
# jointure sur la sys_cat_mm
leftjoin = sys_category_record_mm ON (pages.uid = sys_category_record_mm.uid_foreign)
# condition de recherche
where = sys_category_record_mm.tablenames = "pages" AND sys_category_record_mm.uid_local = {$temp.relatedCAT}
where.insertData = 1
}
}
'lib.related = TEXT'不匹配下列性質。它應該是'lib.related = CONTENT'嗎? –