Support

Account

Home Forums General Issues Problem with Nested Repeaters & Flexible Content

Solving

Problem with Nested Repeaters & Flexible Content

  • ACF is having trouble dealing with nesting. I want to be able to do this.

    STEP 1: ADD ROW CONTAINER
    Flexible Content: Choose between a handful of layouts (one column, two column, etc.)

    STEP 2: SHOW ROW LAYOUT
    Depending on the layout chosen in Step 1, give an appropriate number of columns, spaced as they should be. The flexible content field in Step 1 allows for this.

    STEP 3: ADD SUBROW IN LAYOUT LOCATIONS
    Now, I want users to be able to select a type of content block and stack them in each column. Since you can’t nest flexible content fields within flexible content fields, I use repeaters to add a row.

    STEP 4: CONTENT BLOCKS
    I use a second flexible content field to select from the content types. I add a layout, in row format, for each (HTML Block, Image, Post Object, etc.)

    STEP 4 is where things go whacky. When I add a second flexible content field, it only saves the first layout in the correct nested area. It then adds the rest as blank items in the original flexible content field. I attached a picture of what happens in the level 1 flexible content field.

    Any help?

    Whenever I use nested flexible content fields this happens. It’s not a front-end issue — it actually loads up incorrectly (reproducing what shows in the actual edit page) when I re-edit the field group.

  • Hi @ewestlund
    Thanks for the detail. When you say:

    
    STEP 4 is where things go whacky. When I add a second flexible content field, it only saves the first layout in the correct nested area. It then adds the rest as blank items in the original flexible content field. I attached a picture of what happens in the level 1 flexible content field.
    

    Are you talking about the page edit screen, or the field group edit screen?

    Do you have any info that would explain why the popup box shows 2 empty layouts?

    Do you have nested flexible content fields that are working? If so, in which layout visible in the popup screenshot?

    I think the biggest issue here is that WP and ACF is just not able to save / load that much nested data. Are you able to simplify your fields?

    Thanks
    E

  • Hi! I have the same problem. I’m trying to do the exact same thing as ewestlund.

    1. Choose number of columns
    2. Add content to the column

    I’m set up my Repeaters and Flexible Content like this:

    -Flexible
    — Column 1 as repeater
    —— image as Flexible
    —— “new layout”
    —— Google maps as Flexible
    —— “new layout”
    —— Wysiwyg editor as Flexible

    —— Column 2 as repeater
    —— image as Flexible
    —— “new layout”
    —— Google maps as Flexible
    —— “new layout”
    —— Wysiwyg editor as Flexible

    — Column 3 as repeater
    —— image as Flexible
    —— “new layout”
    —— Google maps as Flexible
    —— “new layout”
    —— Wysiwyg editor as Flexible

    What happens is that when I try to add a new layout they jump out of the hyrarki, and goes in the same hyraki as my columns, but they are empty. The layouts are not being saved. You can see the result in ewestlund’s attached image. This is happening in both page edit screen and the field group edit screen.
    Is it not possible to do it this way? Do you have any other idea how to accomplish the same thing?

    I love your plugin but this is very frustrating.

    Best regards
    dmon

  • Hi @dmon

    Could you please expor your field group to XML and attach it to a comment below? I would like to test the same field group as you.

    Thanks
    E

  • Hi @dmon

    Thanks for the follow up, but can you please next time export the data to XML and .zip it and attach it to a comment, instead of copy / paste the PHP code?

    Thanks
    E

  • Sorry about that. I attached the non working version in XML and zip.

  • Hi @dmon

    Thank mate, this will be much easier for me to import and test!

    Cheers
    E

  • Hi @dmon

    I just tried to import your file, but it failed. Looking at the XML, it looks good so I’m starting ot think that the issue is simply that the serialized array is just too big for WP to handle!

    Can you attempt to import it?

    Thanks
    E

  • Hi @dmon

    Just checking up if you have made any progress with this issue?
    Perhaps you could export to PHP and zip that code?

    Thanks
    E

  • I’m having the exact same problem.

    Section (Flexible)
    – Slider
    — Slide (Repeater)
    — Name
    — Icon
    — Slide Layout (Flexible)
    —- 1 Column

    Everything works up until here… then when I try and add another slide layout.

    —- 2 column
    —- 3 column

    I end up with this…

    Section (Flexible)
    – Slider
    — Slide (Repeater)
    — Name
    — Icon
    — Slide Layout (Flexible)
    —- 1 Column
    – Empty Layout
    – Empty Layout

    So ACF is not allowing me to add more than one layout to a Flexible Content field in a repeater nested in a Flexible Content field.

    Zip of the XML attached.

    Is this possible?

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

The topic ‘Problem with Nested Repeaters & Flexible Content’ is closed to new replies.