问题描述
是否可以为 tx_news 记录中的内容元素关系配置哪些内容元素类型可用?
我有一个后端布局,它只允许 tt_content 中的网格元素。常规内容元素只能在网格元素容器中使用。
目前我面临的问题是,在新闻记录中只能添加网格元素:
我想在新闻记录中只允许某些特定的内容元素。
更新:
上述限制是通过后端布局的 TSConfig 完成的:
mod.web_layout.BackendLayouts {
1 {
title = Standardseite
config {
backend_layout {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = Content
colPos = 0
allowed = gridelements_pi1
}
}
}
}
}
}
}
}
当我删除行 allowed = gridelements_pi1
时,所有内容元素类型都再次可用。
但不管后端布局的 allowed
设置如何,我都希望只有一小部分内容元素类型可用于新闻记录。
解决方法
有时解决方案可以如此简单明了!感谢提示,乔治·林格!
只需覆盖 news sys 文件夹的设置:
[45 in tree.rootLineIds]
# this changes the allowed CTypes. Add more as a comma separated list
mod.web_layout.BackendLayouts.1.config.backend_layout.rows.1.columns.1.allowed = textmedia
# this sets the default CType to prevent an error with INVALID VALUE ("text")
TCAdefaults.tt_content.CType = textmedia
[global]
顺便说一句,更好的解决方案是使用 TCEFORM.tt_content.CType.removeItem = ...
,但这需要在每次添加新 CType 时更新列表。