Support

Account

Home Forums ACF PRO Flexible content field used on multiple templates

Solving

Flexible content field used on multiple templates

  • Hi,

    Are there any drawbacks to using multiple page templates that all use the same Flexible Content field name? Currently, on working on a project that uses Flexible Content for adding a variety of components within a page. If allow for the user to add as many page templates with the same Flexible Content field, would there be any conflicts? I’ve tested it on a variety of pages and it doesn’t appear to conflict in any way. But I wanted to be sure before moving forward.

    Thanks!

  • As long as the top level field names are unique for any WP object there will not be a problem. If you included 2 field groups on a template and they both have a field named “flex_field”, this would cause a problem.

  • So just to be clear (for my own sake…), if I have a Flexible Content with:

    if (have_posts()) : while(have_posts()) : the_post(); 
    if(have_rows('general_layout')) :
    while (have_rows('general_layout')): the_row;
       ...
    endwhile;
    endif;
    endwhile; 
    endif;

    on a page template that can be used multiple times through a site, there should be any conflict. It’s only if have two of those Flexible Content fields with general_layout on a single page that would cause the conflict. Is that correct?

  • Correct.

    In your example, “general_layout” is a unique field on every post/page in the loop.

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

The topic ‘Flexible content field used on multiple templates’ is closed to new replies.