Hi, i created a flexible content field which i want to use on different other ACF-Field Groups which are specific for different page templates.
Now i cloned the flexbile content field but cant get any output. The “get_row_layout” is not working as expected when the fields are cloned.
My code:
<?php if( have_rows('content_modules') ): ?>
<p>Output 1</p>
<?php while ( have_rows('content_modules') ) : the_row(); ?>
<p>Output 2</p>
<?php if( get_row_layout() == 'text' ): ?>
<p>Output 3</p>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
“Output 1” and “Output 2” are on the page but i cant get the content inside the different row_layouts.
“content_modules” is the name of the flexible_content field. The name of the “clone” field is content.
Is it even possible to clone a flexible content field or is there some magic i dont know?
It depends on if the “content” field is seamless or not and other settings for the cloan field. https://www.advancedcustomfields.com/resources/clone/
Very useful to re-use fields within a repeater or flexible content field;