Here’s what I’m doing for now until I find something better.
Embed the info from the entry you want to duplicate as a form within the parent SafeCracker page. Something like:
-----
PARENT
-----
{exp:safecracker channel="my_channel"}
{embed="my_tpl_group/my_form" copy_from_entry_id="123"}
<button id="form_submit" type="submit" class="">Duplicate Program</button>
{/exp:safecracker}
-----
EMBED
-----
{exp:channel:entries channel="my_channel" entry_id="{embed:copy_from_entry_id}" }
{!-- Output the pre-filled form of the entry you are wanting to duplicate --}
<label for="program_number">program_number</label>
<input type="text" name="program_number" id="program_number" value="{if program_number}{program_number}{/if}">
<input type="hidden" name="program_start_date" id="program_start_date" value="{if program_start_date}{program_start_date format='%F %d, %Y'}{/if}">
.....etc.....
{/exp:channel:entries}A better approach would be to use stash http://devot-ee.com/add-ons/stash Using stash, you pull the variable and load them to the form individually.
Hmm - a different approach… so it would be not so much strictly a clone but rather using Stash to get the data for each field from a specific entry ID and populating a blank Channel Form’s fields to make a new entry? Interesting…
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.