Support

Account

Home Forums Add-ons Flexible Content Field Cloned flexible content field cant get data outpu

Solving

Cloned flexible content field cant get data outpu

    • frenz

    • December 3, 2020 at 3:51 am

    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;

Viewing 3 posts - 1 through 3 (of 3 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.