x
 
Create New Page
 View Previous Changes    ( Last updated by Richard The Vague )

Hard Coded Stand Alone EDIT Form Guide

The EDIT form is a companion to the SAEF (Stand Alone Entry Form)

It allows you to edit your entries/posts via templates.

If you haven’t already: SAEF - Standard and SAEF - Hard Coded (using custom entry fields)

This entry is inspired by the 10 page thread on the forum that everyone links to when you ask about this topic. It seems to bounce between several topics and doesn’t really have any good working examples to build off of.  Most of them are: ‘this is my code..  x isn’t working’ The below code works.  Build upon it as you will.

I’d heard you need the form helper plug-in but I got it working without.  It’s pretty simple when you look at it and the originator of the concept / theory is a genius.  Little thing, Big impact.

[IMPORTANT: The Category bit doesn’t work.  I’ve tried a few things and no matter what, the category after pressing submit goes blank.  Everything else works fine.]

The Code:

{exp:weblog:entries limit="1"}
{exp
:weblog:entry_form weblog="{my_weblog}" return="{my_template_group}/index"}

<b>Title:</b><br />
<
input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" /><input type="hidden" name="url_title" id='url_title' value="{url_title}" maxlength="75" size="50" />

<
b>Category:</b><br />
{category_menu}<select name="category"><OPTION selected value="{categories}{category_name}{/categories}">{categories}{category_name}{/categories}</OPTION>{select_options}</select>{/category_menu}

<b>Entry:</b><br />
<
textarea name="field_id_6" id="field_id_6" cols="50" rows="9" maxlength="500">{entry}</textarea><input type='hidden' name='field_ft_6' value='none' />

<
b>Entry Extended:</b><br />
<
textarea name="field_id_7" id="field_id_7" cols="50" rows="9" maxlength="500">{entry-extended}</textarea><input type='hidden' name='field_ft_7' value='none' />

<
input type="submit" name="submit" value="Submit" />

<
input type="hidden" name="allow_comments" value="y" {allow_comments} />
<
input type="hidden" name="allow_trackbacks" value="y" {allow_trackbacks} />
<
input type='hidden' name='dst_enabled' value='y' {dst_enabled} />
<
input type="hidden" name="entry_id" value="{entry_id}" />

{/exp:weblog:entry_form}
{
/exp:weblog:entries}

[if group_id="1"]<a >Edit Post</a>{/if}

Depending on how you have your formatting set per your custom weblog fields, you’re going to see either <br />’s or <p>’s within the text areas.  Formatting is manual after the initial post creation, meaning you need to format the posts as you edit them with <br />’s or <p>’s for spacing.  Please let me know if there’s a way to make it automatic… PM <Richard The Vague> - Thanks

Change the hidden attributes as you wish.. the one that is a must is:

<input type="hidden" name="entry_id" value="{entry_id}" />

It’s how you avoid creating a ton of similar but not same posts.

Good luck & have fun ;)

Category:Templates
Category:SAEF
Category:Unofficial

Categories: