Bug #23815
closedaddToAllTCATypes after certain fields does not work anymore
0%
Description
Since the restructuring of the pallettes and fields the addToAllTCAtypes after:fieldname does not work anymore..
To test try:
t3lib_extMgm::addToAllTCAtypes("tt_content", 'subheader;;8', '', 'after:header');
The field gets added to an empty tab.
(issue imported from #M16096)
Files
Updated by Jo Hasenau about 14 years ago
We already talked about that during the code sprint and came to the conclusion that we need to define a rule for this function:
Do we want to enable developers to insert fields into existing palettes, or do we want to move the field to a place before or after the palette containing the field?
Developers could restructure the whole TCA types and palettes anyway, so this is just about the behaviour of this function.
Opinions please!
Updated by Susanne Moog about 14 years ago
I'd say we want to enable developer to insert fields into existing palettes, as that is the only way to enable a real "after" some field. For example if you take the subheader field:
I want it to appear directly after the header field, not after the whole palette with all the other fields.
Only thing I see is that if you want to create a new palette / place your field after the palette you'd have to be able to specify that, too. Probably with another keyword like "afterpalette:header" or something like that.
(And of course I could restructure the whole TCA types and palettes but that is overkill for simply wanting to add a single field.
Updated by Jo Hasenau about 14 years ago
Then we would just have to make sure that there wil be additional "--linebreak--" inserted as well depending on the position inside the palette, since the palette is based on "nowrap" and "inline-block"
Updated by Ernesto Baschny about 14 years ago
Yes, discussed in our release meeting today. Some "magic --linebreak--" around would indeed be needed to be as "backwards compatible" as possible (the custom fields being rendered more or less on the same context as before and in a "stand alone" line.
Updated by Ingo Renner about 14 years ago
Fixed target version, always set target to final release, use "Fixed in Version" for specific preview releases...
Updated by Jo Hasenau almost 14 years ago
After trying to put the fields into the palettes containing the fieldname to position the field before or after, I found out, that this will lead to multiple field entries as soon as the fieldnames differ for certain types.
i.e.:
t3lib_extMgm::addToAllTCAtypes('pages','tx_dampages_files','1',);
t3lib_extMgm::addToAllTCAtypes('pages','tx_dampages_files','2','after:no_cache');
t3lib_extMgm::addToAllTCAtypes('pages','tx_dampages_files','3','after:media');
would lead to a triple entry for page type 1, since this is using both palettes, no_cache and media, and gets the field appended as well due to the fact that there is no position given in line 1.
So after discussing this with Steffen Kamper, we came to the conclusion that the only option we've got is to position the field as a separate field entry after or before the whole PALETTE containing the fieldname used for the position.
Attached patch does exactly this.
Updated by Björn Pedersen almost 14 years ago
Just for the record:
http://bugs.typo3.org/view.php?id=16349 woudl be solved with this.
Updated by Jo Hasenau almost 14 years ago
Attached V2 patch adds the command "replace:fieldname" to the existing "before" and "after"