georgringer / container-modify-fields
操纵在 EXT:container 容器内的子内容元素
1.0.2
2022-02-16 12:26 UTC
Requires
- b13/container: ^1.5
- typo3/cms-backend: ^9.5 || ^10.4 || ^11.5
README
此扩展允许修改容器子元素的字段 TCA。
示例
- 内容元素 "text" 如果在容器内部,则不应有 "header_link" 字段
- 如果内容元素 "header" 在容器的 colPos "100",则标题必须为必填项。
用法
使用 composer req georgringer/container-modify-fields
安装。
配置
必须在 PageTsConfig 中使用以下语法进行配置
TCEFORM.tt_content.container {
<container-ctype>.<colpos>.<child-ctype>.<field> {
# currently supported is only:
required = 1
disabled = 1
fixedItemValue = 1
}
# Instead of <colpos> and <child-ctype> also "_all" is valid
}
示例 1
容器 "b13-2cols-with-header-container" 内元素的的行为已更改
- 所有元素:没有 header_link 字段
- 元素 "text":没有 header 字段
TCEFORM.tt_content.container {
b13-2cols-with-header-container {
_all {
_all {
header_link.disabled = 1
}
text {
header.disabled = 1
}
}
}
}
示例 2
容器 "b13-2cols-with-header-container" 内元素的的行为已更改
- 在 colPos "200" 的容器内设置标题元素为必填项
TCEFORM.tt_content.container {
b13-2cols-with-header-container {
200 {
header {
header.required = 1
}
}
}
}
示例 3:fixedItemValue
此设置仅适用于选择项:删除所有其他项,因此其值不能再更改。
所有在手风琴容器内的元素的行为已更改
- 将
header_layout
设置为Hidden [100]
。在手风琴中,字段 "header" 用于手风琴标题,不应在内容块中显示- 将
space_before_class
设置为small
(=> 字符串值的示例)
TCEFORM.tt_content.container {
accordion.101._all {
header_layout {
fixedItemValue = 100
}
space_before_class {
fixedItemValue = small
}
}
}