This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

kattsoff
kattsoff

Hi, can you gave me more infomation about using repeater widget. My fields.yaml file, for example:

fields:
    title:
        label: Title
    banners:
        prompt: Banners
        type: repeater
        form:
            fields:
                url:
                    label: URL
                    type: url
                image:
                    label: Banner image
                            type: fileupload
                            mode: image
                            imageHeight: 100
                            imageWidth: 300

What am I doing wrong?

kattsoff
kattsoff

It was a problem with tabs and spaces.

rchemin
rchemin

Hi, and how to save fields in database ?

Hybrid
Hybrid

Did you get this to work with the fileupload widget in the repeater, @kattsoff? When I add it, the display is fine but all the repeated sections share the same image - I think because of the way the repeater fields are saved, it's not really compatible with the fileupload field relationship. I'm interested to know if you found a different solution?

@rchemin - in case you didn't work it out already, the repeater fields are saved as JSON data in a single field so you just need to make sure you have a field of that name (eg. "banners") in your table and then you have to tell the model that the field is JSONable: http://octobercms.com/docs/database/model#attribute-modifiers

eg. protected $jsonable = ['banners'];

Last updated

wHooZaa
wHooZaa

@kattsoff @Hybrid: is there anything solution for this issue? i have same problem also.

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.