0
votes

In a custom extbase content element extension i can use the layout field (appearance -> layout) to switch the fluid template in the Frontend.

But what if I need to switch the complete content element in backend? For example I want to change the labels or the fields in the backend. How can U do this? Or another example: I have an irre link element, where the user decides between an item for text or thumbnail links. How to realize this in my extension?

Does anybody have an existing example?

1

1 Answers

1
votes

In your TCA definition you can use 'type' definitions. One of the fields is defined as type field and when the BE user changes the value other fields, palettes and labels can be shown.

types documentation

As you can see in the documentation for the 'showitem' property you can even change the labels for a field when a different type is selected.

For examples you can look inside the TYPO3 core. One example is the TCA for pages which has a lot of types, one for each doktype.


Regarding the IRRE question, you can show and hide fields using the property displayCond. If you need to reload the form because a displayCond depends on the value of a field you can force that with the onChange property. Note that in TYPO3 v7 the onChange/displayCond combination does NOT work if both are inside a section. It works if the onChange is outside the section and the displayCond is inside a section. This works in 6.2 and again in 8.