Examples
Relation to pages and content elements
A conference refers to pages and content elements with more information:
The related pages and content of a conference
EXT:my_extension/Configuration/TCA/Overrides/157-tx_myextension_conference-related_content.php
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
'related_content' => [
'label' => 'my_extension.db:conference.related_content',
'config' => [
'type' => 'group',
'allowed' => 'pages,tt_content',
'elementBrowserEntryPoints' => [
'_default' => '###SITEROOT###',
],
'suggestOptions' => [
'default' => [
'searchWholePhrase' => true,
],
// Only standard pages
'pages' => [
'searchCondition' => 'doktype = 1',
],
'tt_content' => [
'additionalSearchFields' => 'bodytext',
],
],
],
],
]);
ExtensionManagementUtility::addToAllTCAtypes(
'tx_myextension_conference',
'related_content',
'',
'before:--div--;core.form.tabs:categories',
);
Relation to the speaker of a talk
A talk has one speaker. The field controls edit the speaker, add a new speaker, or open the speakers in the Content > Records module:
The speaker of a talk with field controls
EXT:my_extension/Configuration/TCA/Overrides/210-tx_myextension_talk-speaker.php
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
'speaker' => [
'label' => 'my_extension.db:talk.speaker',
'config' => [
'type' => 'group',
'allowed' => 'tx_myextension_speaker',
'maxitems' => 1,
'relationship' => 'manyToOne',
// The speakers are stored in the same folder as the talks
'elementBrowserEntryPoints' => [
'tx_myextension_speaker' => '###CURRENT_PID###',
],
'fieldControl' => [
'editPopup' => [
'disabled' => false,
],
'addRecord' => [
'disabled' => false,
],
'listModule' => [
'disabled' => false,
],
],
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
],
]);
$GLOBALS['TCA']['tx_myextension_talk']['types']['keynote']['columnsOverrides']['speaker']['config']['minitems'] = 1;
ExtensionManagementUtility::addToAllTCAtypes(
'tx_myextension_talk',
'speaker',
'',
'after:slug',
);