.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../../../Includes.txt .. _developers_ownextension_tca: TCA === Integrate the code from below to your TCA file my_table.php. Replace "my_table" with the name of your table. The php sample from below contains one relation to sys_categories. Adapt the relation to your needs. Ctrl ---- Code in the ctrl section: .. code:: php $TCA = [ 'ctrl' => [ ... // Configuration EXT:multisite begin 'extensions' => [ 'multisite' => [ 'enabled' => true, // Optional. Needed only, if you use another field name than rootpid // 'rootpid' => 'my_rootpid', ] ], // Configuration EXT:multisite end ... Column ------ Code in the column section Quick solution '''''''''''''' Quick solution: * You need one line TCA only. * But your extension depends on EXT:multisite and it will not run without multisite any longer. .. code:: php $TCA = [ ... 'columns' => [ ... 'sys_categories' => [ ... 'config' => [ ... 'foreign_table_where' => '' . 'AND (sys_category.sys_language_uid = 0 OR sys_category.l10n_parent = 0) ' // Configuration EXT:multisite begin . 'AND ' . $tableName . '.' . \Verdigado\Multisite\Utility\TcaTablesUtility::GetRootpidLabel('sys_category') . ' = ###SITEROOT### ' // Configuration EXT:multisite end ... Professional solution ''''''''''''''''''''' Own PHP class plus TCA configuration. Your extension doesn't depend on EXT:multisite. Your extension will run proper in both cases: * EXT:multisite isn't installed: TCA configuration from below hasn't any effect. * EXT:multisite is installed: TCA configuration from below has an effect. PHP class in the directory Class/TCA of your extension: .. code:: php [ ... 'sys_categories' => [ ... 'config' => [ ... 'foreign_table_where' => '' . 'AND (sys_category.sys_language_uid = 0 OR sys_category.l10n_parent = 0) ' // Configuration EXT:multisite begin . MyProviderName\MyExtension\TCA\Rootpid::AndWhere('sys_category') // Configuration EXT:multisite end ...