TYPO3 FlexForm does not appear

This is my code. I do not know where the error is? Please refer to the following code and help me

$pluginSignature = str_replace('_','',$_EXTKEY) . '_rock';

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'Rocktechnolabs.' . $_EXTKEY, 'rock', 'THE FAQS' );

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

in Configuration/FlexForms/flexform_rock.xml

<T3DataStructure>
    <sheets>
        <sDEF>
            <ROOT>
                <TCEforms>
                    <sheetTitle>Function</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el>
                    <switchableControllerActions>
                        <TCEforms>
                            <label>Select function</label>
                            <config>
                                <type>select</type>
                                <items>
                                    <numIndex index="0">
                                        <numIndex index="0">List</numIndex>
                                        <numIndex index="1">Faq->list</numIndex>
                                    </numIndex>
                                    <numIndex index="1">
                                        <numIndex index="0">Search</numIndex>
                                        <numIndex index="1">Faq->search</numIndex>
                                    </numIndex>
                                </items>
                            </config>
                        </TCEforms>
                    </switchableControllerActions>
                </el>
            </ROOT>
        </sDEF>
    </sheets>
</T3DataStructure>

I tried a lot, but I do not get flexform while choosing a plugin. Can you help me find out about the error?

+4
source share
2 answers

You must add the flexform field to the addlist subtypes:

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

make sure yours $pluginSignature matches the result $pluginSignatureinside ExtensionUtility::registerPlugin().

This is what happens in this method:

    $extensionName = str_replace(' ', '', ucwords(str_replace('_', ' ', $extensionName)));
    $pluginSignature = strtolower($extensionName) . '_' . strtolower($pluginName);

It looks different to me :)

Addition $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';, as Rene suggested, is also important.

+2
source

Source: https://habr.com/ru/post/1665516/


All Articles