如何仅对某些 ctypes 禁用 tca 中的字段 [英] how to disable fields in tca only for certain ctypes

查看:41
本文介绍了如何仅对某些 ctypes 禁用 tca 中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用后端中的某些字段,例如网格元素和其他内容元素的许多领域.我知道 TCEFORM 的可能性,但它只允许禁用所有 cType 中的字段.我需要一种方法来仅为某些 cType 禁用某些字段.

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

推荐答案

只要你不需要额外的条件,比如某个用户或组或页面树的特定分支来禁用这些字段,你不应该改用 PageTSconfig 和 TCEFORM 但纯 TCA 类型.

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.

只需创建一个站点包扩展,无论如何都会推荐,并确保为 Configuration/TCA/Overrides/tt_content.php 中的 tt_content 表提供所需的设置,以便自动应用.

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.

您可以在此处找到有关站点包剖析"的一些幻灯片:https://de.slideshare.net/benjaminkott/typo3-the-anatomy-of-sitepackages

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

可以在此处找到有关 TCA 类型的其他信息:https://docs.typo3.org/typo3cms/TCAReference/Types/Index.html

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

由于 Gridelements 只为布局、子项、容器和列提供必填字段,但您不应禁用这些字段,因为它可能会破坏功能.

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.

这篇关于如何仅对某些 ctypes 禁用 tca 中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆