Skip to content

Conversation

@andy-morgan
Copy link
Contributor

When the conditional was applied to a repeater field like so:

        template:
            type: templateselect
            filter: 'page_*.twig'

        carousel:
            type: repeater
            limit: 5
            fields:
                image:
                    type: image
                    extensions: [ gif, jpg, png ]
                strapline:
                    type: text
                contentlink:
                    type: text
                    label: Link
                    placeholder: '/slug or http://example.org/'
 
            condition:
                field: template
                operator: '='
                show: true
                value: [ "page_home.twig" ]

        body:
            type: html
            height: 300px
            condition:
                field: template
                operator: '!='
                show: true
                value: [ "page_home.twig" ]

Then instead of the whole repeater field being hidden, only the first set of the repeater was. This led to a broken interface like so:

screen shot 2017-10-23 at 13 36 17

Instead of the whole carousel field not being shown (which I believe is the intended behaviour).

@graham73may
Copy link
Owner

graham73may commented Oct 27, 2017

Hi,

Ah interesting! The way I use this extension means that I never really have any content in the field before toggling the conditional field so never experienced the repeater issue. Nice find!

Thanks for taking the time to submit a PR, I'll merge this in now.

P.s. Sorry took me so long to reply, this has been in my inbox for the past week but I've just been swamped at work.

@graham73may graham73may merged commit 8eab6b0 into graham73may:master Oct 27, 2017
@graham73may
Copy link
Owner

Just wanted to add an additional comment incase someone stumbles on this later. The extension (at the time of writing this) doesn't empty the field's value, it just hides the field.

So even if you have a repeater with content in that is hidden by a conditional field, the value will still be in the database and will still output on the frontend if your template doesn't also check the conditional field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants