3 users online. Create an account or sign in to join them.Users
duplicating entries
This is an open discussion with 6 replies, filed under Troubleshooting.
Search
Question: Is there a easy way to duplicate entries?
Nope.
Or: Would it be possible to add these option to the With selected ... select box?
Or: Is this possible via an extension?
Extension would be your best bet. It could potentially add a new action to the with-selected, and then subscribe to a delegate that gets triggered when using the with-selected. The delegate doesn't exist yet though.
Sorry to bring up an old thread, but is this still the case with the backend? Or would the easier approach for this be to use events to duplicate items?
Through the frontend, would it be possible to duplicate an item and all of it’s children? For example, duplicating a thread would duplicate all it’s replies.
I found the easiest way to duplicate entries without creating an extension was to populate a front end form with the data from the entry that you want to duplicate. Then, rather than supply the entry ID number to save changes to the entry, you would instead omit the ID number and you could save a new entry with identical data. Using the allow-multiple preference, you could then populate several entries at once and save them all with a single submit action.
With some clever form building and entries filtering, it may be possible to produce the behaviour you are describing. I had also thought that it might be possible to implement a versioning system in this way, just by turning off the publish checkbox for older entries and never overwriting an entry on save, but saving a new entry for every submit action. However, all the old entries would show up in the Symphony admin, so it would require custom admin pages built as front end forms, but displayed only for admin users, to filter out unpublished entries. If you could create an extension to filter out entries with a publish checkbox field set to no, you wouldn’t need to rebuild the Symphony admin pages.
I rather like that idea for versioning, a couple of sites I built use mephisto which has built-in versioning.
After looking at the save-comment event and the form, I can basically see how’s it done. Ideally I’d like to do this on a single page, using a page that returns xml as an intermediary. But I’m unsure about two things, and I’ll use the parent->children relationship to describe them.
So I create a new parent based on an old parent->children relationship, is the new id of the parent returned in the resultant xml? Or can it be? Then that id can be injected as a hidden field for each new child being duplicated.
The second question would be, would you have to submit each child separately? or could you do something like name=”fields[][name]”, as an array? I’m not sure how symphony processes the form.
If you want to try out an example of how this might work, take a look at one of my old beta ensembles, where I’ve implemented a system for either editing or copying multiple entries.
The entries still maintain a relationship to a parent section entry id, and the children are saved simultaneously using an array, just as you’ve guessed.
This is actually the same sort of idea that I’m thinking about using for a WordPress XML import process. It’s theoretical at the moment, but I think it’s doable. I just need to get past the WordPress XML namespace issue, which should be relatively simple. I just haven’t tried it yet.
Create an account or sign in to comment.
Hi there!
With selected ...select box?Nils