Reputation: 929
i search for a Solution: How can i add a new Field in a existing XML ?
extname/Configuration/TCA/Overrides/tt_content.php
...
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['ext_name'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('ext_name',
'FILE:EXT:extname/Configuration/FlexForms/flexform.xml');
...
And here the XML...
...
<T3DataStructure>
...
</T3DataStructure>
...
I am have a Ext. and now i go in my tt_content.php File and copy this Code in. But now i can overright the Full-File! But i need only one new field, and the original should not change!
Thanks!
Upvotes: 0
Views: 430
Reputation: 7939
The fastest way is for sure to just copy the full file and manipulate it. However sometimes it is nice to avoid that and of course there is a solution for that. It is described in the docs of my news extension at https://docs.typo3.org/typo3cms/drafts/github/georgringer/news/DeveloperManual/ExtendNews/ExtendFlexforms/Index.html#extend-flexforms-with-custom-fields.
Upvotes: 2
Reputation: 6460
It's rather unfortunate but that's the way how FlexForms work since they represent a fully embedded and encapsulated data structure. Thus if you want to add a field, there is no other way than to copy the FlexForm file and change the configuration to use your file.
Some extensions allow for other ways to customize existing fields, e.g. via an itemsProcFunc
for select
fields, but obviously the options are very limited here.
Upvotes: -1