Support

Account

Home Forums Add-ons Flexible Content Field Any way to reuse layouts?

Solved

Any way to reuse layouts?

  • I’m trying to think through how to best architect groups of fields.

    It looks like each flexible content group is completely separate/custom. So if I have the same design element and I want to use it multiple places, I can’t reference it from another place? Is that correct?

    I wanted to have certain field-groups that could be included flexibly on different pages, but not always have all of them available depending on the field type.

    If I just name them the same I could use the same view templates in the backend? (I’m new to the plugin so I wonder if there is a way to have)

  • coming soon ACF Pro will include a clone field that will let you use reuses fields or field groups.

  • That’s great! On the backend would it duplicate them or reference them? (ie kept up to date if one of them changes do they both change?)

    In the meantime.. can fields be created through PHP (using exports at first) and assigned to variables and reused that way? We were thinking of storing them in PHP regardless (if that’s a responsible approach…) and I have no problem doing some array/object construction in PHP

  • It references them, so updating the original field updates all locations where it is used. As for the rest of your question, I can’t say, I have not had time to really look at how it works. The only thing that I know it that Elliot is working on it for the next release of ACF Pro (V 5.4.0). There are some add ons that do this, including one created by myself, but they will not be compatible with the the new ACF Clone field and I’d hesitate to use them when this is so close to being completed.

  • Do you think we are talking days, weeks, months do you think? I’m not familiar with the update cycle.

    I may play around with seeing if I can do it manually in the meantime

  • ..I accidentally clicked the thumbs up to mark my post as the topic solution and can’t see how to undo it :p

    So with layouts and flexible content.. a layout is the unit of flexible content, but that wouldn’t allow us to use a group of fields as a layout would it? That was how I was imagining using it to have predefined things like ‘resource list’, ‘feature list’, ‘hero’ etc but be able to control somewhat which pages get which layouts as options

  • I honestly cannot say. The best I can say is, as soon as all the bugs are worked out of 5.4. These things usually don’t take that long. Like I said, I wouldn’t have even said anything except that anyone that uses another solution now if they could have waited would not be very happy.

    Actually, yes, you could use an entire field group as the fields for a “Layout”. It’s going to make life a lot easier for developers that uses the same sequence of fields multiple times.

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

The topic ‘Any way to reuse layouts?’ is closed to new replies.