typo3typo3-extensionstx-gridelements

TYPO3 Ext. gridelements: Remove field from FlexForm


With TCEFORM in Page TS, you can remove a FlexForm field from an extension plugin, e.g. from EXT:news:

TCEFORM.tt_content.pi_flexform.news_pi1.additional.settings\.detailPid.disabled = 1

The example above is working, but how can I remove a field from a gridelements FlexForm?

This is not working:

TCEFORM.tt_content.pi_flexform.gridelements_pi1.mySheet.myField.disabled = 1

More detailled:

I use EXT:bootstrap_grids, which provides FlexForm "flexform_2col.xml". From this FlexForm, I want to disable tab "largeDevices" with fields "lgCol1" and "lgCol2":

<T3DataStructure>
    <sheets>
        [...]
        <largeDevices>
            <ROOT type="array">
                <TCEforms>
                    <sheetTitle>LLL:EXT:bootstrap_grids/Resources/Private/Language/locallang_db.xlf:grid.sheet.largeDevices</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el type="array">
                    <lgCol1 type="array">
                        <TCEforms type="array">
                            <label>LLL:EXT:bootstrap_grids/Resources/Private/Language/locallang_db.xlf:grid.label.col1</label>
                            <config type="array">
                                <type>select</type>
                                <renderType>selectSingle</renderType>
                                <itemsProcFunc>Laxap\BootstrapGrids\Controller\FlexFormController->getTwoColumnOptions</itemsProcFunc>
                            </config>
                        </TCEforms>
                    </lgCol1>
                    <lgCol2 type="array">
                        <TCEforms type="array">
                            <label>LLL:EXT:bootstrap_grids/Resources/Private/Language/locallang_db.xlf:grid.label.col2</label>
                            <config type="array">
                                <type>select</type>
                                <renderType>selectSingle</renderType>
                                <itemsProcFunc>Laxap\BootstrapGrids\Controller\FlexFormController->getTwoColumnOptions</itemsProcFunc>
                            </config>
                        </TCEforms>
                    </lgCol2>
                </el>
            </ROOT>
        </largeDevices>

But it seems, EXT:gridelements handles the FlexForm in some other way so it can't be manipulated with TCEFORM, this is not working:

TCEFORM.tt_content.pi_flexform.gridelements_pi1.largeDevices.lgCol1.disabled = 1

Solution

  • The key "gridelements_pi1" is wrong. It can be either "default", effecting all gridelement layout types or a specific type you defined.

    So this would work for the excample from the question:

    TCEFORM.tt_content.pi_flexform.default.largeDevices.lgCol1.disabled = 1