Home › Forums › Add-ons › Flexible Content Field › Gutenberg Blocks in Flexible Content Fields › Reply To: Gutenberg Blocks in Flexible Content Fields
So I found the Clone field from which I can reference the fields from another Field Group. It seems to be working! Now I can have Elementor take over my WP Editor and still have Flexible Fields below it so that my clients can fill in simple content without messing with carefully laid out layouts made with Elementor. One remaining issue is the render_template for the block. I now need to ask if we are in a row_layout or not.
<?php
//Normal Gutenberg Block
$quote = get_field("quote");
//See if it's really a Flexible Content Row
if(get_row_layout() == 'gutenberg_testimonial_block'){
$quote = get_sub_field('quote');
}
?>
<div class="acf-block-testimonial">
<blockquote><?= $quote ?></blockquote>
</div>
It would be a little messy on more complicated templates.
Does my above solution make sense or does anyone else have input on a better way?
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.