Skip to content

Instantly share code, notes, and snippets.

@rsanchez
Created November 14, 2011 15:12
Show Gist options
  • Save rsanchez/1364133 to your computer and use it in GitHub Desktop.
Save rsanchez/1364133 to your computer and use it in GitHub Desktop.
Duplicate entry with Safecracker
{!--example url: template_group/template/123--}
{exp:safecracker entry_id="{segment_3}" return="template_group/template/ENTRY_ID"}
...
{!--
this is the trick that duplicates the entry
even though entry_id 123 is LOADED into this form
this blank entry_id field will trick SC into thinking
this is a new entry
--}
<input type="hidden" name="entry_id" value="">
{/exp:safecracker}
{!-- add this code if you are using Matrix (w/ PHP on Input) --}
<?php $_GET['clone'] = 'y' ?>
@rklaeboe
Copy link

rklaeboe commented Jan 8, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment