当我使用单独的主题自定义文件时,我无法让主题自定义表单字段显示在后端。这就是我做的。在我的theme.yaml文件中 - 我有以下代码:form: config/fields.yaml
。这样可以使自定义按钮显示在后端。
但是,我不是100%确定如何格式化config / fields.yaml文件。目前,这就是我设置它的方式:
form:
fields:
layout:
label: Layout
comment: Choosed between a boxed or wide layout.
type: dropdown
options:
stretched: Stretched
boxed: Boxed
但没有出现。
我尝试取出'形式:' - 仍然没有显示出来。
我做错了吗?
答案 0 :(得分:3)
删除fields.yaml中的“form:”并重新注册所有。
form: fields: layout: label: Layout comment: Choosed between a boxed or wide layout. type: dropdown options: stretched: Stretched boxed: Boxed
fields: layout: label: Layout comment: Choosed between a boxed or wide layout. type: dropdown options: stretched: Stretched boxed: Boxed
这应该有效!缩进对于正确解释YAML至关重要