Support

Account

Home Forums ACF PRO Duplicating contents of flexible layout group

Solving

Duplicating contents of flexible layout group

  • Hi there.

    I’ve been finding building modular layout functionality with ACFPRO extremely powerful. In particular what I’m working on at the moment a modular HTML email template designer to users can quickly create email layouts using a common set of modules.

    One thing which would improve workflow dramatically is if there is an ability for editors to duplicate an existing module (i.e ‘ACF flexible layout’ in other words a group of more than one field). Some layout groups consist of up to 10 or so fields so if theres a way to duplicate these groups of fields that would be really useful. Its hard to find out if this question has been asked before as often when the word ‘duplicate’ is used it is more of a problem relating to a bug report or another issue.

    Sorry if this question is a bit vague at the moment. I can provide more information.

    Many thanks

  • Hi @richimgd

    This isn’t currently possible, but it would be quite simple to write some JS to do add another button to each layout and add in the duplicate functionality. If you wish to do this, p[lease dive into the pro/js/pro-input.js file and look at the acf.fields.flexible_content object and all it’s functions.

    Otherwise, you will need to take the manually approach of adding a layout and then copy / paste the values across from one layout to another.

    I can’t imagine why you would need to duplicate content in an email. Can you provide an example of when you would duplicate a layout including the values?

  • This is my biggest priority with ACF. It’s been a great asset over the years, but this feature would make it the most powerful template builder for WordPress. Using the Flexible Content field, I’ve been able to create a set of “modules” that I use on every site I build. When I create a new page for the site, I just add some modules, pop in the content, and I’m done. It allows me to have repeatable flexible layouts in the easiest way I can imagine. Great work, Elliot!

    The only thing that’s missing here is the ability to duplicate a field group that has been populated with data. So, for instance, a user creates a page and clicks to add a banner layout (“module”). They input all of the settings I’ve created to make the banner, and it looks great. Now they want to create another banner right below that on the page, but instead of copying the module they’ve already created, they have to start all over and enter in all of those settings from scratch. The ability to duplicate a flexible layout with all of the data that’s been entered into a previous layout is essential for rapid production.

    The next extension of this issue is duplicating modules between different pages. A user sees a page on the site that they like a piece of. They go to the admin and click on Add New page. Since I’ve setup the site in modules, it’s easy to recreate any of the pieces from any page that exists on the site. However, the same problem exists as above; they have to recreate all of the settings from scratch. It would be awesome if we could create a custom_post_type called “templates” or something similar, and save the settings of a specific layout as a “template”. Then we could choose from the pre-created templates (similar to default values) when adding a layout to a page.

    If anyone knows if this already exists, I’d love to hear about it. If not, this piece would make this already awesome plugin the best page builder on the market. The API is better than anything else out there for creating fields. And the design is rock-solid.

  • If anyone knows if this already exists, I’d love to hear about it. If not, this piece would make this already awesome plugin the best page builder on the market.

    +1

    Page Builder by SiteOrigin and ACF would be a perfect couple. PB is very flexible, you can duplicate elements, save layout templates and more. Unfortunately PB and ACF are not compatible yet.

    For now plugins like this (beta) trying to solve that:
    https://github.com/Angrycreative/ACF-Page-Builder-Field

  • Hi @kitt

    I’m not sure what you can do with Page Builder, but there’s a plugin created by John that allows you to duplicate field groups for ACF Pro. Please take a look at this thread to learn more about it: https://support.advancedcustomfields.com/forums/topic/reusable-field-groups/. I’m not sure if it will work with your situation, but I guess there’s no harm in trying it.

    Another method would be registering the fields by using the PHP code. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/register-fields-via-php/. With this method, you can create the required layouts as variables and then add them to the right place programmatically.

    I hope this makes sense 🙂

  • Maybe this will be helpful to someone: https://github.com/infazz/flexible-templates
    This plugin alows saving of the templates for Flexible Content field, same as for other page builders out there

    Also, if someone faces some issues/problems let me know 🙂

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

You must be logged in to reply to this topic.