Reputation: 41
I added the possibility to set a detailPid in my Extension via flexforms:
<ROOT>
<type>array</type>
<el>
<settings.detailPid>
<TCEforms>
<label>
LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:flexforms.overview.detailPid
</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<show_thumbs>1</show_thumbs>
<wizards>
<suggest>
<type>suggest</type>
</suggest>
</wizards>
</config>
</TCEforms>
</settings.detailPid>
</el>
</ROOT>
I want to set the default detailPid via TS in my setup.ts:
plugin.tx_events_eventdetail {
settings {
listPid = {$plugin.tx_events_eventdetail.settings.listPid}
detailPid = {$plugin.tx_events_eventdetail.settings.detailPid}
}
}
My problem is, that if I don't configure a detailPid in my plugin, the default value from my TS is not used. The settings.detailPid in my Controller or in the FLUID-Template is empty. Is there a way to just fix that?
I already looked around and found out, that the news-extension has the same behavior.
Thanks for any help and suggestions!
Upvotes: 0
Views: 884
Reputation: 2685
You can rename your flexforms detailPid path to something like settings.flexform.detailPid
then in your controller you may merge the settings from TS with those from the Flexform so that only non empty values will take affect.
ArrayUtility::arrayMergeRecursiveOverrule($this->settings, $this-settings['flexform'])
Upvotes: 1
Reputation: 7939
At least the extensions tt_address and news have a configuration which allow a fallback to TS if flexform is empty. If you need that, you can copy the code and use that in your extension.
There is no configuration available in the core for that.
Upvotes: 1