Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get TYPO3 Plugin settings from FlexForms in controller

I have a FE Plugin which uses a FlexForm MyExtFlexForm which is used to set certain configurations like limit or SourcePage etc..

In my controller action list I get these settings using $this->settings. Works fine till now.

Now, I make AJAX calls to action update and I need to use the same settings which have been set earlier through the FlexForm for the FE plugin on this page. $this->settings does not show anything.

I checked $GLOBALS['TSFE']->tmpl->setup['plugin']['MyExt.']['settings.'] and none of the settings defined in FlexForm show here.

How do I solve this issue?

EDIT:

My sample Flexform looks like this:

<sheets>
        <sDEF>
            <ROOT>
                <TCEforms>
                    <sheetTitle>View Settings</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el>
                    <switchableControllerActions>
                        <TCEforms>
                            <label>Select</label>
                            <config>
                                <type>select</type>
                                <items>
                                    <numIndex index="0">
                                        <numIndex index="0">MyFunction</numIndex>
                                        <numIndex index="1">MyExt->list</numIndex>
                                    </numIndex>
                                </items>
                            </config>
                        </TCEforms>
                    </switchableControllerActions>

                    <settings.flexform.limit>
                        <TCEforms>
                            <label>Number of items to be displayed</label>
                            <config>
                                <type>input</type>
                                <size>10</size>
                            </config>
                        </TCEforms>
                    </settings.flexform.limit>
                </el>
            </ROOT>
        </sDEF>
    </sheets>

Then I make an AJAX call to my controller action and print this $this->settings , shows no settings.

like image 217
dora Avatar asked Sep 14 '26 19:09

dora


1 Answers

I just came across a solution: https://forum.typo3.org/index.php/t/194022/eigener-extbase-controller-keine-flexform-werte

I was including the plugin like this:

AJAX_PAGE = PAGE
AJAX_PAGE {
    typeNum = 2

    10 < tt_content.list.20.myPlugin

    config {
        disableAllHeaderCode = 1
        xhtml_cleaning = 0
        admPanel = 0
        debug = 0
        no_cache = 1
    }
}

In order to load the settings correctly it should be:

AJAX_PAGE = PAGE
AJAX_PAGE {
    typeNum = 2

    10 < styles.content.get
    10 {
        select.where = colpos = 0
        select.andWhere = list_type='myPlugin'
    }

    config {
        disableAllHeaderCode = 1
        xhtml_cleaning = 0
        admPanel = 0
        debug = 0
        no_cache = 1
    }
}
like image 73
maechler Avatar answered Sep 16 '26 10:09

maechler