Hey,
my first post here. 🖖
Alex
I have spend multiple hours trying to figure a way around this and to my likings I haven’t found an ideal solution. The problem is Innerblocks isn’t really an ACF function but a WordPress function.
Although I don’t really understand your question the closest I’ve come to a workable pagebuilder with container+columns is this way:
This is a content container block
$allowed_blocks = [ 'acf/contentpartial' ];
<div id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($className); ?>">
<?php if($container == 'container-fluid'): echo '<div class="container">'; endif; ?>
<div class="row">
<InnerBlocks
allowedBlocks="<?php echo esc_attr( wp_json_encode( $allowed_blocks ) ); ?>"
/>
</div>
<?php if($container == 'container-fluid'): echo '</div>'; endif; ?>
</div>
In which you load the partial:
$allowed_blocks = [ 'core/heading', 'core/paragraph','core/list', 'core/button', 'core/image', 'core/shortcode', 'gravityforms/form'];
$col = get_field('col_grootte');
?>
<div id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($className); ?> <?php echo $col; ?> pt-<?php the_field('ruimte_boven'); ?> pb-<?php the_field('ruimte_onder'); ?> editor-reset">
<div class="content-block">
<InnerBlocks allowedBlocks="<?php echo esc_attr( wp_json_encode( $allowed_blocks ) ); ?>" />
</div>
</div>
This only problem is that you have to manually select the column size. It can’t be col-6 whenever there are 2 partials automatically.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.