Category

New in version 11.4: The TCA field type called category has been added to TYPO3 Core. Its main purpose is to simplify the TCA configuration when adding a category tree to a record. It therefore supersedes the CategoryRegistry as well as the ExtensionManagementUtility->makeCategorizable(), which required creating a “TCA overrides” file.

While using the type category, TYPO3 takes care of generating the necessary TCA configuration and also adds the database column automatically. Developers only have to configure the TCA column and add it to the desired record types.

$GLOBALS['TCA'][$myTable]['columns']['categories'] = [
   'config' => [
      'type' => 'category'
   ]
];

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
   $myTable,
   'categories'
);

The following options can be overridden via page TSconfig, TCE form:

  • size
  • maxitems
  • minitems
  • readOnly
  • treeConfig

Note

It is still possible to configure a category tree with type=select and renderType=selectTree. This configuration will still work, but could in most cases be simplified, using the new category TCA type.