Support

Account

Home Forums Add-ons Flexible Content Field Page Builder

Solved

Page Builder

    • Josh.PS

    • January 23, 2020 at 10:40 pm

    Hi,

    I have created a ‘Page Builder’ plugin that has 4 sets of field groups.

    Columns – ( 100%, 50%/50%, 25%/75% ect )
    Custom – ( Used if I want specific created modules per project )
    Modules – ( Accordian, Contact Form, WYSIWIG Editior )
    Settings – ( Row Settings, ie padding/background colour/text colour )

    All the above work fine and flawlessly, basically the Columns are preset in the field groups and for example;

    If i was to select 50%/50% – This would then generate the field group ‘Modules’. If I then add a WYSWIG editor in both, add an image in the left, and text in the right.. This works fine..

    But my question is does ACF support where in my example I want to put an image in the left column but then add an additional option to re add columsn inside the right half to say another 50%/50%. So my column structure I would be after would be:

    50% / [50% / 50% ]

    I have tried cloning the columns field group inside the ‘Modules’ field group but it doesent render anything in the editor.

    I hope someone can help!

    Thanks
    Josh

  • Do you use Bootstrap? I am working on something similar, my attempt is to have standard width that you can edit.

    https://imgur.com/WsSqxM4

    • Josh.PS

    • January 28, 2020 at 7:53 pm

    No mine uses a custom CSS grid system – but you change the column width classes in the settings

    $columns[‘six’] = ‘six columns’;

    If you wanted to use bootstrap you would just change it to:

    $columns[‘six’] = ‘col-lg-6’;

  • The reason that nothing shows when you try to clone the columns is that you’re creating an infinite loop cloning the fields

    
    columns -> clone columns -> clone columns -> clone columns -> etc...
    

    your sub columns will need to be different fields. Create a “sub columns” field group and then clone that into you columns.

    • Josh.PS

    • February 5, 2020 at 11:11 pm

    Thank you for your reply John,

    YES, this solved my issues. But because I am now doing flexible content within flexible content (both using cloned fields)

    The data is not being pulled? It is storing in the database correctly but nothing is being pulled..

    while ( have_rows( $id ) ) : the_row();
    
                if( get_row_layout() == 'content' ):
    
                 	flexi_get_template_part( 'content' );
    
                elseif( get_row_layout() == 'accordian' ): 
    
                    flexi_get_template_part( 'accordian' );
    
                elseif( get_row_layout() == 'contact_form' ): 
    
                    flexi_get_template_part( 'contact-form' );
    
                elseif( get_row_layout() == 'columns' ): 
    
                    //THIS IS WHERE I AM TRYING TO LOOP THROUGH MY CLONED SUB COLUMNS.
                    $arr = get_defined_vars();
                    print_r($arr);
    
                endif;
    
    endwhile;

    If you see in the columns, all it returns is $id string. It seems that nested flexible content is not supported?

    • Josh.PS

    • February 5, 2020 at 11:37 pm

    Ignore my previous post – I managed to fix it!

    Thanks John.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.