TCA

Create the file Configuration/TCA/Overrides/some_table.php. Replace "some_table" with the name of the table, you want to extend with a root pid.

some_table.php

Copy the code from below into ext_tables.sql. Replace "some_table" with the name of the table, you want to extend with a root pid.

The php sample from below contains two relations:

  • one to fe_groups

  • and one to sys_categories

Adapt the relations to your needs.

<?php

use Verdigado\Multisite\Utility\TcaAndWhereUtility;

/* * *****************************
 * ctrl
 * ***************************** */

$GLOBALS['TCA']['some_table']['ctrl']['extensions']['multisite'] = [
    // EXT:multisite will take some_table into account
    'enabled' => true,
    // Optional: If your rootpid field isn't called rootpid
    //'rootpid' => 'my_rootpid'
];

/* * *****************************
 * columns
 * ***************************** */

$columns = [
    'categories' => [
        'tableLocal'   => 'some_table',
        'tableForeign' => 'sys_category'
    ],
    'fe_group'   => [
        'tableLocal'   => 'some_table',
        'tableForeign' => 'fe_groups'
    ]
];

TcaAndWhereUtility::Set($columns);