Home › Forums › Feature Requests › Repeater field : duplicate row
Hello,
First, thanks for such a great plugin. It saves my day on every projects.
But a little enhancement would be great. On a post edit form, in a repeater row, it would be great to have a button “duplicate” to add a new row with fields filled with datas from the duplicated row. And then simply edit values to change.
For example : I use a repeater field with 10 inputs. The first row, I fill the 10 fields. And I want to add a row with almost the same values except 1 field. I have to “Add a row”, and fill (or copy / paste) datas in the new field, 9 times. With the “duplicate” button, I only have to edit 1 value.
I’ll mark this for the developer to take a look at when he has time.
I would say to look at this, http://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/
I actually thought about trying my hand at this, but it would not be a simple thing. Once I started thinking about everything that it would needed to do this it’s became something that I would not to maintain. Especially since I’m not that familiar with the JavaScript side of ACF.
I think that copying something like text fields could be simple, however, if this was something that was added to ACF, or and add on that another developer created, it would be far more complicated. Once you add duplicating text fields then someone will want to be able to do the duplication no matter what type of sub fields are in the repeater, including nested repeaters or even flexible content fields. Then once that’s done someone will want to do the same thing with flexible content fields.
BIGGEST +1 from me here. I have messed about for short amounts of time trying to build this feature myself, but haven’t gotten around to it completely.
I’ve actually looked at it a couple of times. On of the complex parts for me is where to put the button and what icon to use. I keep hitting a brick wall here because there really isn’t anywhere to put it. Over on the right you have the + and – buttons and these just barely fit on a collapsed row. On the left you have the collapse icon and the row counter, again these barely fit when the row is collapsed.
Take a look at the layouts and the CSS involved and come up with a plan. I’m also working on a project right now where this would be extremely useful.
Here’s what would be involved when the button is clicked, and the complexities listed her might give you some idea of why Elliot hasn’t added something like this. It’s far from simple.
For my current project I’m going to be building something that only deals with repeaters and nested repeaters, because that’s what I need. Also, the types of fields that it deals with in those repeaters will be limited and fairly simple.
+1, very useful.
It would be great also for Table field add-on, since replicating similar complex tables several times could be pesky.
I’ve been working on similar functionality for my Repeater Tabs plugin, updated today with the working code.
It’s only been tested on my own use-cases, but works so far with Standard and 1-child-deep nested Repeater Fields.
Hover over the tabs to get the “COPY” option.
More details are in the readme.
Hope this helps, maybe even with developing John’s further.
https://github.com/JamesParkNINJA/acf-repeater-tabs
The topic ‘Repeater field : duplicate row’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.