FluidTYPO3 / flux

TYPO3 extension Flux: Dynamic Fluid FlexForms
https://fluidtypo3.org
146 stars 212 forks source link

[Feature] Allow modification of TCA default-fields (f.e. hide "header_link" field) #1860

Closed typoworx-de closed 1 year ago

typoworx-de commented 3 years ago

Feature request to allow modification of TCA default-fields (f.e. hide "header_link" field).

I've been trying to directly access it using $GLOBALS['TCA']['tt_content'] and 'types' array. But this is always overruled by Flux PHP-Generator providing this more or less on-the-fly.

Using TS-Config works, like the following example - but it's not as flexible and easy to handle as it could be:

TCEFORM.tt_content {
    header_link.types {
        myfluxpackage_myfce.disabled = 1
    }
}

I really would love to have some kind of Event-Observer based hook in Flux taking place where the TCA-Array is rendered for a given FCE. It could also make sense to provide some kind of flux-ViewHelper like

<flux:form.override field="header_link" disabled="1" />'
<flux:form.override field="header_layout" items="{ 0: 'Default', 1: 'Special Headline 1' }" merge="1" />'

I think the arguments of the ViewHelper are more or less self-explaining. merge="0" (or not defining) would completly replace the options and merge will merge/replace them, but keep the existing one.

This way we could recycle existing tt_content fields and will be much more flexible in providing a clean layout!

NamelessCoder commented 1 year ago

I really would love to have some kind of Event-Observer based hook in Flux taking place where the TCA-Array is rendered for a given FCE.

In case the newly added feature isn't flexible enough for your use cases, you can always add a custom Provider class with higher priority than the Flux-native one, and override the method processTableConfiguration. This will let you control 100% of the behavior for any field - flux or native - by manipulating the FormEngine configuration manifest.