Building a TYPO3 extension in Extbase/Fluid

Plugin Options for content elements: FlexForms

see also:

File paths are relative to the root of your extension /typo3conf/ext/your_extension/

ext_tables.php ›››

if(TYPO3_MODE == 'BE') {
$ext_name = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$pluginSignature = strtolower($ext_name).'_yourplugin';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:your_ext/Configuration/FlexForms/flexform_xyz.xml');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:your_ext/Configuration/FlexForms/flexform_xyz.xml');


  • the included php class selections will return select fields for the FlexForm (see below)
  • $pluginSignature: extname_pluginname (lowercase, no underscores within the two parts of the pluginSignature)
  • FlexForm is being added to the form (see below)

The included class “selections” that sets up the select list

namespace VendorName\YourExt\Resources;

// this class will setup the select lists for the plugin options in tt_content form
class selections {
        public function listOptions($config) {
                $optionList[0] = array(0 => 'Make your selection', 1 => 0); // 0: option text; 1: option value
                $optionList[1] = array(0 => 'First Option', 1 => 1); // 0: option text; 1: option value
                $optionList[2] = array(0 => 'Second Option', 1 => 2); // 0: option text; 1: option value
                $config['items'] = array_merge($config['items'], $optionList);
                return $config;

if(defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/your_ext/Resources/class.selections.php']) {




<?xml version="1.0"?>
<!-- this file contains the plugin options (tt_content form) -->
                <!-- langDisable: important! – otherwise there will be a big fat DEF: below the header Plugin Options -->

For more information on how to build the XML FlexForm see this tutorial
 (already mentioned above)
Take care to wrap the single fields within <el></el> with <settings.flexform.yourSettingName> </settings.flexform.yourSettingName> to make them available as settings in the Controller
NOTE: it should also be working without .flexform thus <settings.yourSettingName> but I haven’t checked

Calling the stored settings in the Controller function

  • use $this->settings['yourSettingName']
  • for a deeper settings structure use <settings.arrayName.yourSettingName> in the FlexForm and call it by $this->settings['arrayName']['yourSettingName']

Note, that the settings are NOT AVAILABLE in the Repository. So if you call a Repository method from your Controller method you must pass the settings.