【发布时间】:2019-07-23 08:28:18
【问题描述】:
我正在尝试在 ext:form 内容元素中获取内容对象数据的布局字段,以便在选择了特定布局的情况下添加一个 css 类。但是内容对象数据既没有添加到流体模板 (typo3/sysext/form/Classes/Controller/FormFrontendController.php:73) 中,也没有为此元素渲染来自 fluid_styled_content 的框架容器。
我的布局字段是这样配置的:
TCEFORM.tt_content {
layout {
types.form_formframework {
addItems {
200 = Blue Form
}
removeItems = 1,2,3
}
}
}
我也尝试向表单配置本身添加一个新的布局字段:
TYPO3:
CMS:
Form:
########### FORMEDITOR CONFIGURATION ###########
prototypes:
standard:
########### DEFAULT FORM ELEMENT DEFINITIONS ###########
formElementsDefinition:
Form:
formEditor:
editors:
9000:
identifier: 'layout'
group: select
templateName: 'Inspector-SingleSelectEditor'
label: 'Layout'
propertyPath: 'properties.layout'
selectOptions:
0:
value:
label: Normal
1:
value: form--blue
label: Blau
这在后端很有效,但会导致前端出现The options "properties" were not allowed 错误,因为表单元素的属性在typo3/sysext/form/Classes/Domain/Model/FormDefinition.php:382 中是硬编码的。
任何想法如何在这里添加布局选择?最好是在内容元素上,因为这将允许我使用具有不同布局的相同表单配置,而不是制作仅在布局中区分的重复表单配置。
【问题讨论】:
标签: forms typo3 typo3-extensions