中继器内的标签页

时间:2019-07-13 00:58:31

标签: octobercms octobercms-backend octobercms-widgets

我需要以octoberCMS后端形式在转发器内添加标签

我尝试使用fields.yaml

fields:
    content_items:
        label: "scv.facelessapi::lang.plugin.blocks.fields"
        span: full
        type: repeater
        comment: "scv.facelessapi::lang.plugin.blocks.fields_description"
        prompt: "scv.facelessapi::lang.plugin.custom_actions.add_new_item"
        form:
            fields:
                field_code:
                    label: "Field Code"
                    placeholder: "Field Code"
                    span: storm
                    comment: "Readable field code"
                    required: true
                    cssClass: "col-md-3"
                field_label:
                    label: "Field Label"
                    placeholder: "Field Label"
                span: storm
                comment: "Label of the field"
                required: true
                cssClass: "col-md-3"
                field_type:
                    label: "Field Type"
                    placeholder: "Field Type"
                    span: storm
                    comment: "Input type of the field"
                    required: true
                    cssClass: "col-md-3"
                    type: dropdown
                    options:
                        text: Text
                field_tab:
                    label: "Field Tab"
                    placeholder: "Field Tab"
                    span: storm
                    comment: "Tab of the field"
                    required: true
                    cssClass: "col-md-3"
                    type: dropdown
                    options:
                        content: Content
                        settings: Settings
                field_comment:
                    label: "Field Comment"
                    placeholder: "Field Comment"
                    span: storm
                    comment: "Comment for the field"
                    cssClass: "col-md-12"
            tabs:
                fields:
                    field_comment2:
                        label: "Field Comment"
                        placeholder: "Field Comment"
                        tab: tabexample

到目前为止没有运气,没有显示选项卡按钮,并且在其他字段(field_code,field_label,...)下显示了字段注释2

也尝试将此链接用作参考,它适用于嵌套形式,但不适用于转发器。 [尽管我必须在[标签]下添加[字段]定义 [https://octobercms.com/docs/backend/forms#widget-nestedform] 1

感谢任何帮助或示例,谢谢!

1 个答案:

答案 0 :(得分:0)

我发现了将选项卡包装在转发器内部的嵌套表单中的解决方案,我认为这不是一个好的解决方案,因为它将使保存在数据库中的json变得复杂:

fields:
    contents:
        type: repeater
        label: Contents
        form:
            fields:
                content:
                     type: nestedform
                     usePanelStyles: false
                     form:
                          tabs:
                              fields:
                                   field_code:
                                        label: Field Code
                                        tab: Basic Settings
                                   field_options:
                                        label: Field Options
                                        type: dropdown
                                        tab: Advanced Settings