【发布时间】:2021-09-10 08:38:16
【问题描述】:
我在 Typo3 中有几个产品页面,每个页面都可以分配不同的产品组和属性 - 为此我使用 Typo3 类别。有 5 个主要类别,每个类别都有几个子类别:
Series [id=1] | Shape [id=2] | Color [id=3] | Decor [id=4] | Widths [id=5]
-----------------|-----------------|-----------------|-----------------|----------------
Series #1 [id=8] | Shape #1 [id=10]| Color #1 [id=15]| Decor #1 [id=18]| Width #1 [id=23]
Series #2 [id=6] | Shape #2 [id=9] | Color #2 [id=17]| Decor #2 [id=19]| Width #2 [id=22]
Series #3 [id=27]| Shape #3 [id=11]| Color #3 [id=16]| Decor #3 [id=20]| Width #3 [id=24]
| Shape #4 [id=13]| | Decor #4 [id=21]| Width #4 [id=25]
| Shape #5 [id=12]| | | Width #5 [id=26]
基于这些类别,产品预告片的输出将被过滤。您应该能够选择一个或多个产品系列,并通过选择其他类别进一步缩小选择范围。
在我看来,子类必须用 OR 链接,而主要类别必须用 AND 链接。
但是我该怎么做呢?
我已经尝试过使用以下排版,不幸的是没有成功:
lib.product-teaser = COA
lib.product-teaser {
10 = CONTENT
10 {
table = pages
select {
pidInList.data = register:dTid
recursive = 5
selectFields.dataWrap = *, sys_category.uid AS catUid, pages.uid AS pgUid, pages.title AS pgTitle, tt_content.uid AS recUid
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 JOIN tt_content ON pages.uid = tt_content.pid
groupBy = sys_category_record_mm.uid_foreign
where {
cObject = COA
cObject {
10 = TEXT
10 {
value = tt_content.CType='mask_cnt_tsr_page'
}
20 = TEXT
20 {
if.isGreaterThan.data = register:dCid1
if.value = 0
value.dataWrap = AND sys_category_record_mm.uid_local IN ({register:dCid1})
#dCid1 contain a comma-seperated list of IDs of the subcategories from the specific main categorie (id=1), which the user has selected.
}
30 = TEXT
30 {
if.isGreaterThan.data = register:dCid2
if.value = 0
value.dataWrap = AND sys_category_record_mm.uid_local IN ({register:dCid2})
# dCid2 contain a comma-seperated list of IDs of the subcategories from the specific main categorie (id=2), which the user has selected.
}
40 = TEXT
40 {
if.isGreaterThan.data = register:dCid3
if.value = 0
value.dataWrap = AND sys_category_record_mm.uid_local IN ({register:dCid3})
# dCid3 contain a comma-seperated list of IDs of the subcategories from the specific main categorie (id=3), which the user has selected.
}
50 = TEXT
50 {
if.isGreaterThan.data = register:dCid4
if.value = 0
value.dataWrap = AND sys_category_record_mm.uid_local IN ({register:dCid4})
# dCid4 contain a comma-seperated list of IDs of the subcategories from the specific main categorie (id=4), which the user has selected.
}
60 = TEXT
60 {
if.isGreaterThan.data = register:dCid5
if.value = 0
value.dataWrap = AND sys_category_record_mm.uid_local IN ({register:dCid5})
# dCid5 contain a comma-seperated list of IDs of the subcategories from the specific main categorie (id=5), which the user has selected.
}
}
}
}
renderObj = COA
renderObj {
[...]
}
}
}
提前感谢您的帮助!
【问题讨论】:
标签: mysql typo3 typoscript