Search code examples
typo3

how to disable fields in tca only for certain ctypes


I want to disable certain fields in the backend, e.g. many fields of gridelements and other content elements. I know about the possibilities of TCEFORM but it allowes only to disable a field in all cTypes. I need a way to disable certain field only for certain cTypes.

Is there a way to achieve this? Thanks


Solution

  • As long as you don't need additional conditions like i.e. a certain user or group or a particular branch of the page tree to disable these fields, you should not go for PageTSconfig and TCEFORM but pure TCA types instead.

    Just create a site package extension, which would be recommended anyway, and make sure to provide the desired setup for the tt_content table within Configuration/TCA/Overrides/tt_content.php so it will be applied automatically.

    You can find some slides about the "Anatomy of Sitepackages" here: https://de.slideshare.net/benjaminkott/typo3-the-anatomy-of-sitepackages

    Additional information about the TCA types can be found here: https://docs.typo3.org/typo3cms/TCAReference/Types/Index.html

    As Gridelements just provides mandatory fields for layout, children, container and column, you should not disable these fields though, since it might break the functionality.