Pete
Pete

Reputation: 564

How to offer custom FE plugin settings in TYPO3 7.6 extensions?

In general you use flexforms to offer custom TYPO3 plugin settings. So I've setup the following lines in my ext_tables.php:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'DS.Dscontrolpanel',
    'Dsentitymodullist',
    'Entitymodullist'
);

// ...

// Flexform
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dscontrolpanel_entitymodullist'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dscontrolpanel_entitymodullist','FILE:EXT:dscontrolpanel/Configuration/FlexForms/flexform_dscontrolpanel.xml');

and start a little test flexform just to test it (flexform_dscontrolpanel.xml):

<T3DataStructure>
<ROOT>
    <TCEforms>
        <sheetTitle>Test 1</sheetTitle>
    </TCEforms>
    <type>array</type>
    <el>
        <test>
            <TCEforms>
                <label>Test 2</label>
                <config>
                    <default>1</default>
                    <type>check</type>
                    <items type="array">
                        <numIndex index="1" type="array">
                            <numIndex index="0">enabled</numIndex>
                            <numIndex index="1">1</numIndex>
                        </numIndex>
                    </items>
                </config>
            </TCEforms>
        </test>
    </el>
</ROOT>

After that I cleared both the TYPO3 cache and the PHP opcode cache. But nothing happens in my FE Plugin form. Is there a new way in TYPO3 7.6+ to add custom settings to TYPO3 FE plugins or do I just miss something?

Upvotes: 1

Views: 668

Answers (2)

Aristeidis Karavas
Aristeidis Karavas

Reputation: 1956

Why don't you just register a frontend plugin? Then it will automatically generate a flexform for you, which you can extend, plus it will give you this by default

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $extKey . '/Configuration/FlexForms/flexform_your_extension.xml');

I will not change my first answer, but apparently i was wrong. Follow these steps and you ll be able to add your FlexForm:

Just in case

$pluginSignature = str_replace('_', '', $extKey) . '_yourextensionKey';

Register your FlexForm:

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';

Find your FlexForm:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $extKey . '/Configuration/FlexForms/FlexFormNameHere.xml');

Upvotes: 0

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10800

I think you have build wrong the plugin siganture.

dscontrolpanel_dsentitymodullist instead of dscontrolpanel_entitymodullist

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'DS.Dscontrolpanel',
    'Dsentitymodullist',
    'Entitymodullist'
);

// ...

// Flexform                                                                        vv
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dscontrolpanel_dsentitymodullist'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
//                  vv
    'dscontrolpanel_dsentitymodullist',
    'FILE:EXT:dscontrolpanel/Configuration/FlexForms/flexform_dscontrolpanel.xml'
);

Upvotes: 2

Related Questions