So I have a SafeCracker form that lets members create a classified ad entry. That form works fine. Now how do I build the ‘edit entry’ form? There are no examples of this on the User Guide.
This is the “list entries” page, where I have listed each member’s open ads:
{embed="inc/begin_head" entry_title="Edit Classified Ad"}
{embed="inc/end_head"}
{embed="inc/limited_sidebar"}
{embed="membership/menu"}
<h2>Edit My Classified Ad</h2>
<p>{if logged_out}<br />
<a href="http://{path=">Log in</a> to edit your entries.<br />
{/if}<br />
{if logged_in}<br />
{exp:safecracker channel="classifieds" return="/classifieds/edit/ENTRY_ID" author_only="yes" error_handling="inline" entry_id="{segment_3}"}<br />
<li><a href="http://{path=classifieds/edit}/{entry_id}">Edit - {title}</a></li><br />
{/exp:safecracker}<br />
{/if}<br />
{embed="inc/footer"}This is the form to post a classified entry:
{embed="inc/begin_head" entry_title="Place Classified Ad"}
{embed="inc/end_head"}
{embed="inc/limited_sidebar"}
{embed="membership/menu"}
<h2>Place Classified Ad</h2>
<p>{if logged_in}<br />
{exp:safecracker channel="classifieds" return="/classifieds/edit/ENTRY_ID" author_only="yes" error_handling="inline" class="safecracker"} <br />
All listings expire in 30 days.<br />
<label class="reverse" for="form-title">Title</label></p>
<p> <input id="form-title" name="title" type="text" size="75" value="{title}" /></p><br />
{custom_fields}<br />
{field_errors}{error}{/field_errors}<br />
{if wygwam}<br />
{display_field}<br />
{/if}<br />
{if matrix}<br />
{display_field}<br />
{/if}<br />
{if textarea}<br />
<label class="reverse" for="{field_name}">{field_label}</label></p>
<p><textarea id="{field_name}" name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}">{field_data}</textarea></p><br />
{/if}<br />
{if textinput}<br />
<input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" /></p><br />
{/if}<br />
{if date}<br />
<input type="text" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" /><br ><br />
{/if}<br />
{if file}<br />
{display_field}<br />
{/if}<br />
{/custom_fields} <br />
<input type="submit" value="Submit" /></p> <br />
{/exp:safecracker}<br />
{if:else} You are not logged in. Please <a href="http://{path=">log in</a>.{/if}<br />
{embed="inc/footer"}