【问题标题】:Tab inside repeater中继器内的标签
【发布时间】:2019-11-22 17:15:38
【问题描述】:

我需要在 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

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

也尝试将此链接用作参考,它适用于嵌套形式,但不适用于中继器。 [虽然我必须在 [tabs] 下添加 [fields] 定义 [https://octobercms.com/docs/backend/forms#widget-nestedform]1

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

【问题讨论】:

    标签: octobercms octobercms-backend octobercms-widgets


    【解决方案1】:

    我找到了将选项卡包装在中继器内的嵌套表单中的解决方案,我想这不是一个好的解决方案,因为它会使保存在数据库中的 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
    

    【讨论】:

      猜你喜欢
      • 2014-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多