Typo3 如何在databaseQueryProcessor中使用所选类别?
我有一个简单的内容元素,我已经添加了categories字段。 用户选择其选择的父类别 我想使用Typo3 如何在databaseQueryProcessor中使用所选类别?,typo3,typoscript,fluid,typo3-9.x,Typo3,Typoscript,Fluid,Typo3 9.x,我有一个简单的内容元素,我已经添加了categories字段。 用户选择其选择的父类别 我想使用DatabaseQueryProcessor将子类别列表输出到所选类别 如何设置where的格式,使其获得所选类别的父类别 10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 10 { if.isTrue.field = categories table = sys_category selectField
DatabaseQueryProcessor
将子类别列表输出到所选类别
如何设置where
的格式,使其获得所选类别的父类别
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
if.isTrue.field = categories
table = sys_category
selectFields = sys_category.*
pidInList = {$categories}
recursive = 999
where = parent = ???
as = categories
}
根据TSRef,数据库查询处理器使用select函数及其参数。 所以类似的东西应该是有效的-(未经测试)
再次感谢您。这将使用选定的类别,但不作为父类别。我可以用流体来忽略第一个层次,看看孩子们,达到我想要的效果。
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
if.isTrue.field = categories
table = sys_category
selectFields = sys_category.*
pidInList = {$categories}
recursive = 999
join = sys_category_record_mm ON sys_category_record_mm.uid_local = sys_category.uid
where.dataWrap = sys_category_record_mm.uid_foreign={field:_ORIG_uid // field:uid} AND sys_category_record_mm.tablenames = 'mytable' AND sys_category_record_mm.fieldname = 'myfield'
orderBy = sys_category_record_mm.sorting_foreign
languageField = 0
as = categories
}