rainlab / builder-plugin

Visual development tool for October CMS
Other
171 stars 61 forks source link

Repeater maxItems #373

Closed jjezik82 closed 1 year ago

jjezik82 commented 1 year ago

Hello, I am trying to create a repeater with pre-defined fields where should be exact number of items in repeater. Default fields are shown perfectly in creating new record. The problem is, that maxItems setting is in this case ignored (also minItems). I can add more items if I want. Is there problem with my repeater settings? Thanks.

in my fields.yaml

fields:
    progress: 
        label: Time line
        prompt: Add
        maxItems: '6'
        displayMode: default
        span: full
        type: repeater
        tab: 'Time line'
        form:
            fields:
                title:
                    label: title
                    span: auto
                    type: text
                body:
                    label: Text
                    size: tiny
                    span: auto
                    type: textarea
                is_active:
                    label: 'Active'
                    span: auto
                    type: switch
        default:
            0:
                title: 'Contract signed'
            1:
                title: 'Begining of construction'
            2:
                title: 'Foundations finished'
            3:
                title: 'First floor finished'
            4:
                title: 'Building finished'
            5:
                title: 'Final touches'
daftspunk commented 1 year ago

Hi @jjezik82!

Try removing this line

displayMode: default

We may need to include some sanitsation of this field, since it supports only two values: accordion or builder. Setting to default produces an unfinished display mode.

jjezik82 commented 1 year ago

Hi @jjezik82!

Try removing this line

displayMode: default

We may need to include some sanitsation of this field, since it supports only two values: accordion or builder. Setting to default produces an unfinished display mode.

This worked perfectly! Thanks.