如何在TYPO3 7.6扩展中提供自定义FE插件设置?

时间:2018-05-17 09:02:09

标签: typo3 extbase typo3-7.6.x typo3-extensions

通常,您使用flexforms来提供自定义TYPO3插件设置。所以我在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');

并开始一点测试flexform只是为了测试它(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>

之后我清除了TYPO3缓存和PHP操作码缓存。但我的FE插件形式没有任何反应。在TYPO3 7.6+中有一种新方法可以为TYPO3 FE插件添加自定义设置,还是我只是错过了什么?

2 个答案:

答案 0 :(得分:2)

我认为你修改了插件siganture。

?代替dscontrolpanel_dsentitymodullist

dscontrolpanel_entitymodullist

答案 1 :(得分:0)

为什么不注册前端插件?然后它会为你自动生成一个flexform,你可以扩展,另外它会默认为你提供

NameError: name 'reload' is not defined

我不会改变我的第一个答案,但显然我错了。按照以下步骤操作,您将能够添加FlexForm:

以防万一

$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');

注册您的FlexForm:

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

找到你的FlexForm:

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