[TYPO3-v4] t3lib_extMgm::addToAllTCAtypes() before:field / after:field became quite unhandy

JoH asenau info at cybercraft.de
Wed Jan 19 21:15:16 CET 2011


> Both don't really work as supposed. They add the field and at least the
> new_title is "close" to the regular "nav_title" but it is not placed on
> the palette - it's just placed before/after the palette where the
> related field is placed. I wasn't able to figure out a way to have nice
> looking results with the API.

Which is the intended behaviour to leave the palette layout intact 
unless it is to be changed on purpose.

This way we make sure that existing extension won't cripple the new 
layout of tt_content and pages by accident.

before:field and after:field will insert stuff as close as possible to 
the palette containing the field. The new parameter replace:field will 
automatically work inside palettes as well, since it will be used by new 
versions of extensions anyway, so we can expect the developers know what 
they are doing.

> So the question is - what is the suggested way to add new fields into
> existing table/tca definitions to get nice results, without raising the
> maintenance level up too much?

The addFieldsToAllPalettesOfField method you mentioned has another 
approach, since it will add fields to palettes that are attached to 
certain field, which is not the case with the current pages and 
tt_content layouts, since they are using stand alone palettes that are 
not attached to any field at all.

So you can keep the old way of doing it but with the drawbacks mentioned 
above or you could use the extMgm method addFieldsToPalette() with the 
same parameters - before, after or replace - to put the fields into an 
existing palette.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


More information about the TYPO3-project-v4 mailing list