listModule 

listModule
Type
array
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['listModule']
Scope
Display
Types
group

The list module control button opens the Content > Records module for only one table and allows the user to manipulate stuff there.

Options 

disabled 

disabled
Type
boolean
Default
true
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['listModule']['disabled']
Scope
Display

Disables the field control. Needs to be set to false to enable the Create new button

options[pid] 

options[pid]
Type
string
Default
###CURRENT_PID###
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['listModule']['options']['pid']
Scope
Display
Values
marker or an integer

List records from this pid. Can be an hard pid setting, or one of these markers, see select foreign_table_where.

Falls back to "current pid" if not set, forces pid=0 if records of this table are only allowed on root level.

  • ###CURRENT_PID###
  • ###THIS_UID###
  • ###SITEROOT###

options[table] 

options[table]
Type
string
Default
First table from property allowed / foreign_table
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['listModule']['options']['table']
Scope
Display
Values
name of the table

List records of this table only, falls back to first table from allowed list if not set for type='group' fields and to foreign_table for type='select' fields.

options[title] 

options[title]
Type
string
Default
LLL:core.core:labels.list
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['listModule']['options']['title']
Scope
Display
Values
plain text label or label reference

Allows to set a different 'title' attribute to the popup icon.

Examples 

Select field 

The speakers of a conference with field controls

The speakers of a conference with field controls

EXT:my_extension/Configuration/TCA/Overrides/125-tx_myextension_conference-speakers.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'speakers' => [
    'label' => 'my_extension.db:conference.speakers',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectMultipleSideBySide',
      'foreign_table' => 'tx_myextension_speaker',
      'MM' => 'tx_myextension_conference_speaker_mm',
      // Speakers in the default language, not their translations
      'foreign_table_where' => 'AND {#tx_myextension_speaker}.{#sys_language_uid} IN (-1, 0) ORDER BY tx_myextension_speaker.name',
      'size' => 5,
      'autoSizeMax' => 20,
      'fieldControl' => [
        'editPopup' => [
          'disabled' => false,
          'options' => [
            'title' => 'my_extension.db:conference.speakers.edit',
          ],
        ],
        'addRecord' => [
          'disabled' => false,
          'options' => [
            'title' => 'my_extension.db:conference.speakers.add',
            // A new speaker comes first in the list of selected speakers
            'setValue' => 'prepend',
          ],
        ],
        'listModule' => [
          'disabled' => false,
          'options' => [
            'title' => 'my_extension.db:conference.speakers.list',
          ],
        ],
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'speakers',
  '',
  'before:--div--;my_extension.db:tab.details',
);
Copied!

Group field 

The speaker of a talk with field controls

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',
);
Copied!