Support

Account

Home Forums ACF PRO Repeater field with multiple flexible content fields having problems

Solving

Repeater field with multiple flexible content fields having problems

  • Hi-

    Giant Images: Before and After

    I have a Repeater field which contains a dropdown and three Flexible Content fields. The Flexible Content fields (are supposed to) each contain the same 5 layouts: title, blurb, image, video, button.

    An example of the field layout I am going for “Field Name (Field Type)”:

    Sections (Repeater)
        Columns (Dropdown)
        Column 1 (Flexible Content)
            Title
                Title (Text)
            Blurb
                Blurb (Textarea)
            Image
                Image (Image)
                Link (URL)
            Video
                Video (oEmbed)
            Button
                Button Text (Text)
                Button Link (URL)
        Column 2 (Flexible Content)
            Title
                Title (Text)
            Blurb
                Blurb (Textarea)
            Image
                Image (Image)
                Link (URL)
            Video
                Video (oEmbed)
            Button
                Button Text (Text)
                Button Link (URL)
        Column 3 (Flexible Content)
            Title
                Title (Text)
            Blurb
                Blurb (Textarea)
            Image
                Image (Image)
                Link (URL)
            Video
                Video (oEmbed)
            Button
                Button Text (Text)
                Button Link (URL)

    After saving this, I end up with something like this:

    Sections (Repeater)
        Columns (Dropdown)
        Column 1 (Flexible Content)
            Title
                Title (Text)
            Blurb
                Blurb (Textarea)
            Image
                Image (Image)
                Link (URL)
            Video
                Video (oEmbed)
            Button
                Button Text (Text)
                Button Link (URL)
        Column 2 (Flexible Content)
            Title
                Title (Text)
                Blurb (Textarea)
                Image (Image)
                Link (URL)
                Video (oEmbed)
                Button Text (Text)
                Button Link (URL)
            Blurb
            Image
            Video
            Button
        Column 3 (Flexible Content)

    Notice how in Column 2, all fields have moved to be underneath Title and Column 3 is just empty.

    I did some Googling around and saw mentions of max_input_vars and upped that from 1000 to 3000, but that seems to have made it even worse. The column fields will move to be inline with the column # dropdown field.

  • Can you export the field group as a JSON file and attach it? You may need to put it in a .zip file. I’d like to test this out without creating the entire field group myself.

  • Sure!

  • So, what I’m seeing in the field so far is

    
    Sections (Repeater)
        Columns (Select)
        Column 1 (Flexible Content)
            There are 5 layouts to choose from
        Column 2 (Flexible Content)
            There are 5 layouts to choose from
        Column 3 (Flexible Content)
            There are 5 layouts to choose from
    

    I’m not seeing how this relates either of the hierarchies that you posted. Do you mean to have all of the fields in all of these 5 layouts in a single layout?

  • The problem I’m having is with the fields within the layouts. The layouts aren’t moving after save. When I have the fields in the order I need and I click Update, majority of the fields from Column 2+3 move “up.”

    For example — looking at the columns, after saving I now have:

    Column 1 (Flexible Content)
        Title (Layout)
            Button Text (text)
            Title (text)
            Video (oEmbed)
            Button Link (url)
            Link (image)
        Blurb (Layout)
            Blurb (wysiwyg)
        Image (Layout)
            Image (image)
        Video (Layout)
        Button (Layout)

    Column 2 looks like this:

    Column 2 (Flexible Content)
        Title (Layout)
            Title (text)
            Blurb (wysiwyg)
            Image (image)
            Video (oEmbed)
            Button Text (text)
            Link (image)
            Button Link (url)
        Blurb (Layout)
        Image (Layout)
        Video (Layout)
        Button (Layout)

    and Column 3 has only layouts containing no fields.

    Could it be the names I’m giving fields? Instead of calling each Column’s Layout’s Fields something like “link,” instead call it “col1_link”?

  • I tried just ditching what I had and recreating it.

    Create Repeater Field. Save. Add column_1 Flexible Content to Repeater Field. Save. Add first Layout. Save. Add Text field to Layout. Save. Add second Layout. Save. Add Image field to second Layout. Save.

    I end up with one Layout with the label and name ‘Image’ containing the first Text field ‘Title’ (see attached).

  • I could have swore I posted a comment a couple of days ago on this… hmm, hopefully I didn’t post it on the wrong topic

    I was looking at the export you sent and I think the reason you were having a problem is that the field keys are duplicate. Field keys must be unique and this is likely causing the issue when you save the field group.

    Is ACF creating the duplicate field keys when you create a new field? Show the field keys and let me know if they get duplicated when you add a new field.

  • This reply has been marked as private.
  • okay, so I just followed the exact sequence that you posted and everything worked fine for me and did not do what you describe. If the field keys are being duplicated then you need to figure out what’s causing that because that’s probably what’s causing the issue.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Repeater field with multiple flexible content fields having problems’ is closed to new replies.