Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Last active December 15, 2015 04:29
Show Gist options
  • Save lukeholder/5201972 to your computer and use it in GitHub Desktop.
Save lukeholder/5201972 to your computer and use it in GitHub Desktop.
craft update form with GUID
THIS:
<form method="post" action="" accept-charset="UTF-8">
<input type="hidden" name="action" value="entries/saveEntry">
<input type="hidden" name="redirect" value="blog/{{ entry.slug }}">
<input type="hidden" name="GUID" value="{{ entry.guid }}">
<label for="title">Title</label>
<input id="title" type="text" name="title" value="{{ entry.title }}">
<label for="body">Body</label>
<textarea id="body" name="fields[body]">{{ entry.body }}</textarea>
<input type="submit" value="Publish">
</form>
VS:
<form method="post" action="" accept-charset="UTF-8">
<input type="hidden" name="action" value="entries/saveEntry">
<input type="hidden" name="redirect" value="blog/{{ entry.slug }}">
<input type="hidden" name="entryId" value="{{ entry.id }}">
<input type="hidden" name="sectionId" value="1">
<input type="hidden" name="slug" value="{{ entry.slug }}">
<input type="hidden" name="enabled" value="1">
<label for="title">Title</label>
<input id="title" type="text" name="title" value="{{ entry.title }}">
<label for="body">Body</label>
<textarea id="body" name="fields[body]">{{ entry.body }}</textarea>
<label for="keywords">Keywords</label>
<input id="keywords" type="text" name="fields[keywords]" value="{{ entry.keywords }}">
<input type="submit" value="Publish">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment