OctoberCMS显示Fields Repeater的计数数量

时间:2017-12-28 15:28:42

标签: php octobercms octobercms-plugins octobercms-backend

我想知道如何在转发器的某个位置显示索引的编号,或者显示添加了多少转发器的计数器。 为了更好地理解,我目前有这个转发器。

enter image description here

我的代码是:

tabs:
    fields:
        questions:
            label: 'Perguntas e Respostas'
            oc.commentPosition: ''
            prompt: 'Adicionar nova pergunta'
            span: storm
            cssClass: col-sm-12
            type: repeater
            tab: Perguntas
            form:
                fields:
                    question:
                        label: 'Qual a pergunta?'
                        oc.commentPosition: ''
                        span: storm
                        cssClass: col-sm-5
                        type: text
                    placeholder:
                        label: 'Placeholder para o Campo'
                        oc.commentPosition: ''
                        span: storm
                        cssClass: col-sm-3
                        type: text
                    identifier:
                        label: 'Identificação da pergunta'
                        comment: 'Apenas uma palavra para identificar está pergunta'
                        oc.commentPosition: ''
                        span: storm
                        cssClass: col-sm-4
                        type: text
                        required: true
                    type_answer:
                        label: 'Tipo de Resposta'
                        oc.commentPosition: ''
                        options:
                            input: 'Campo de texto livre'
                            phone: 'Campo de telefone'
                            email: 'E-mail'
                            cpf: 'CPF'
                            select: 'Lista de opções'
                            sql: 'Selecionar do Banco de Dados'
                        emptyOption: Selecione
                        span: storm
                        cssClass: col-sm-4
                        type: dropdown
                    data_next:
                        label: 'Ir para pergunta'                  
                        span: storm
                        cssClass: col-sm-2
                        comment: 'Caso esteja vazio a proxima pergunta será a que estiver na ordem do questionario'
                        type: text
                        trigger:
                            action: show
                            field: type_answer
                            condition: value[input] value[sql] value[email] value[phone]                    
                    sql_table:
                        label: 'Tabela'
                        oc.commentPosition: ''
                        options:
                            Unit: 'Unidades'
                            Company: 'Empresas'
                            Car: 'Modelos'
                        emptyOption: Selecione
                        span: storm
                        cssClass: col-sm-3
                        type: dropdown
                        trigger:
                            action: show
                            field: type_answer
                            condition: value[sql]
                    answer_options:
                        label: 'Opções para resposta'
                        oc.commentPosition: ''
                        prompt: 'Adicionar opções'
                        span: storm
                        cssClass: col-sm-8
                        type: repeater
                        trigger:
                            action: show
                            field: type_answer
                            condition: value[select]
                        form:
                            fields:
                                text:
                                    label: Opção
                                    oc.commentPosition: ''
                                    span: auto
                                    type: text
                                data_next:
                                    label: 'Ir para a resposta'
                                    span: auto
                                    type: text
                                    comment: 'Caso esteja vazio a proxima pergunta será a que estiver na ordem'

我的意图是,对于添加的每个新字段,转发器都会显示一个数字,因此更容易识别。

感谢您的帮助!

0 个答案:

没有答案