Extend FlexForms

Following fields of the plugin configuration can be extended without overriding the complete FlexForm configuration.

Selectbox "Sort by"

The sorting can be extended by adding the value to


Default values are: tstamp,datetime,crdate,title

Additional Template Selector

If you need a kind of template selector inside a plugin, you can add your own selections by adding those to

$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['templateLayouts']['myext'] = ['My Title', 'my value'];

You can then access the variable in your template with {settings.templateLayout} and use it for a condition or whatever.

Extend FlexForms with custom fields

If you need additional fields in the FlexForm configuration, this can be done by using a hook in the Core.

Register the Event

Add this to Services.yaml of your extension:

            - name: event.listener
              identifier: 'flexParsing'
              event: TYPO3\CMS\Core\Configuration\Event\AfterFlexFormDataStructureParsedEvent

Add the hook

Create the class ModifyFlexformEvent in your extension in Classes/EventListener/ModifyFlexformEvent.php and add the path to an additional FlexForm file.


namespace Vendor\ExtKey\EventListener;

use TYPO3\CMS\Core\Configuration\Event\AfterFlexFormDataStructureParsedEvent;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class ModifyFlexformEvent
    public function __invoke(AfterFlexFormDataStructureParsedEvent $event): void
        $dataStructure = $event->getDataStructure();
        $identifier = $event->getIdentifier();

        // $identifier['dataStructureKey'] depends on the selected plugin!
        if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content' && $identifier['dataStructureKey'] === '*,news_pi1') {
            $file = GeneralUtility::getFileAbsFileName('EXT:extKey/Configuration/Example.xml');
            $content = file_get_contents($file);
            if ($content) {
                ArrayUtility::mergeRecursiveWithOverrule($dataStructure['sheets'], GeneralUtility::xml2array($content));


Create the FlexForm file

Create the FlexForm file you just referenced in the hook. This can look like that. (Syntax for TYPO3 12 LTS+)

                    <label>Max. number of posts to display per page</label>