您能否告诉我在流体模板中获取CE元素类别的适当方法是什么?
谢谢。
答案 0 :(得分:0)
好的,我在TS中这样做了:
lib.categories = CONTENT
lib.categories {
table = sys_category
select {
pidInList = 1
selectFields = sys_category.uid
join = sys_category_record_mm on sys_category_record_mm.uid_local = sys_category.uid
where.field = recordUid
where.wrap = sys_category_record_mm.uid_foreign=|
}
renderObj = COA
renderObj {
1 = TEXT
1 {
field = uid
stdWrap.noTrimWrap = |
}
}
}
在流体模板中这样:
<div class="wrapper {f:if(condition: '{f:cObject(typoscriptObjectPath: \'lib.categories\', data: {recordUid: data.uid})} == 2', then: 'category', else: 'default')}"></div>