Reputation: 427
I'm writing a TCA to define a form, and I need to fill the select with the childs categories from sys_category table.
'category' => [
'label' => 'LLL:EXT:hebo_ideas/Resources/Private/Language/locallang_db.xlf:hk_ideas_idea.category',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'sys_category',
'foreign_table_where' => ' AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC',
'MM' => 'sys_category_record_mm',
'size' => 10
],
],
I understand that I have to use foreign_table_where
but I don't know what parameter from TYPO3 core database should I use to filter this categories by parent. Or may be my approach is wrong?
Upvotes: 0
Views: 371
Reputation: 3747
If you want to add categories to your table, you should use \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable()
. Thats the easiest way. Please have a look at the documentation for details.
Upvotes: 0