Retired Documentation:  You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to the latest version.

Stand-Alone Entry Form

Using this tag, you can create an entry form to submit entries to any of your weblogs outside of the Control Panel.

Users of this form must be members of the site and must be logged in. Further, the user's Member Group must have permission to post entries to the appropriate weblog. No content will appear if the user is not logged in.

Here is an example of how the tag might be used to create an entry form:

{exp:weblog:entry_form weblog="default_site" return="site/index" preview="site/entry"}

{preview}
<h1>{title}</h1>

{display_custom_fields}

{/preview}


<table>
<tr>
<td>

<p>Title<br />
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" /></p>

<p>URL Title<br />
<input type="text" name="url_title" id='url_title' value="{url_title}" maxlength="75" size="50" /></p>

{formatting_buttons}

<p><a href="{upload_url}" onclick="window.open(this.href, '_blank', 'width=400,height=600');return false;" onkeypress="this.onclick()">File Upload</a>

<a href="{smileys_url}" onclick="window.open(this.href, '_blank', 'width=600,height=440');return false;" onkeypress="this.onclick()">Smileys</a></p>

{custom_fields}
{if required}* {/if}{field_label}<br />
{field_instructions}
{if textarea}
<textarea id="{field_name}" name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}" onclick="setFieldName(this.name)">{field_data}</textarea><br />
{/if}

{if textinput}
<input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" /><br />
{/if}

{if pulldown}
<select id="{field_name}" name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}<br />
</select>
{/if}

{if date}
<input type="text" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" /><br />
{/if}

{if relationship}
<select id="{field_name}" name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}<br />
</select>
{/if}
{/custom_fields}

<p>Trackback URLs<br />
<textarea name="trackback_urls" cols="50" rows="5">{trackback_urls}</textarea> </p>

</td>
<td valign="top">

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

{status_menu}
<p>Status<br />
<select name="status">
{select_options}
</select>
</p>
{/status_menu}

<p>Date <br />
<input type="text" name="entry_date" value="{entry_date}" maxlength="23" size="25" /></p>

<p>Expiration Date <br />
<input type="text" name="expiration_date" value="{expiration_date}" maxlength="23" size="25" /></p>

<p>Comment Expiration Date <br />
<input type="text" name="comment_expiration_date" value="{comment_expiration_date}" maxlength="23" size="25" /></p>

<p><input type="checkbox" name="sticky" value="y" {sticky} /> Make Entry Sticky</p>
<p><input type="checkbox" name="allow_comments" value="y" {allow_comments} /> Allow Comments</p>
<p><input type="checkbox" name="allow_trackbacks" value="y" {allow_trackbacks} /> Allow Trackbacks</p>
<p><input type='checkbox' name='dst_enabled' value='y' {dst_enabled} />DST Active on Date of Entry</p>

{ping_servers}
<p>Ping Servers<br />
{ping_row}
<input type="checkbox" name="ping[]" value="{ping_value}" {ping_checked} /> {ping_server_name}<br />
{/ping_row}
</p>
{/ping_servers}

{category_menu}
<p>Categories<br />
<select name="category[]" size="4" multiple="multiple">
{select_options}
</select>
</p>
{/category_menu}

</td>
</tr>
</table>

{/exp:weblog:entry_form}

Further, you should add these CSS styles to whatever stylesheet you use when displaying your entry form so that the formatting buttons will appear correctly.

Input Fields

All of the fields available on the Control Panel Publish page are available. However, the only required fields are the Title field and any entry fields which you have specified in your Admin > Custom Weblog Fields as required.

Allow Comments

You may allow the user to choose whether or not to allow comments on the entry.

<p><input type="checkbox" name="allow_comments" value="y" {allow_comments} /> Allow Comments</p>

Allow Trackbacks

You may allow the user to choose whether or not to allow trackbacks on the entry.

<p><input type="checkbox" name="allow_trackbacks" value="y" {allow_trackbacks} /> Allow Trackbacks</p>

Category Menu

This allows the user to select one or more categories for the entry.

{category_menu}
<p>Categories<br />
<select name="category[]" size="4" multiple="multiple">
{select_options}
</select>
</p>
{/category_menu}

Comment Expiration Date

The user can specify the exact date for comment expiration if desired. This is specified in the format YYYY-MM-DD hh:mm PM exactly as in the Control Panel Publish section.

<p>Comment Expiration Date <br />
<input type="text" name="comment_expiration_date" value="{comment_expiration_date}" maxlength="23" size="25" /></p>

Custom Entry Fields

The entry fields are displayed dynamically by ExpressionEngine. These are displayed by an outer variable pair, which loops through all of the fields for the weblog and then displays a field appropriate for the type.

{custom_fields}
{if required}* {/if}{field_label}<br />

{if textarea}
<textarea name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}" onclick="setFieldName(this.name)">{field_data}</textarea>
{/if}

{if textinput}
<input type="text" dir="{text_direction}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" />
{/if}

{if pulldown}
<select name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
</select>
{/if}

{if date}
<input type="text" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" />
{/if}

{if relationship}
<select name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
</select>
{/if}
{/custom_fields}

Note: The onclick="setFieldName(this.name)" attribute is only needed if you are including the formatting buttons in the form.

DST Enabled

You may allow the user to choose whether or not to store that DST is active with the entry.

<p><input type="checkbox" name="dst_enabled" value="y" {dst_enabled} /> DST Active on Date of Entry</p>

Entry Date

The user can specify the exact date for the entry. This is specified in the format YYYY-MM-DD hh:mm PM exactly as in the Control Panel Publish section.

<p>Date <br />
<input type="text" name="entry_date" value="{entry_date}" maxlength="23" size="25" /></p>

Expiration Date

The user can specify the exact expiration date for the entry if desired. This is specified in the format YYYY-MM-DD hh:mm PM exactly as in the Control Panel Publish section.

<p>Expiration Date <br />
<input type="text" name="expiration_date" value="{expiration_date}" maxlength="23" size="25" /></p>

Formatting Buttons

You may include the formatting button toolbar just like in the Control Panel Publish section.

{formatting_buttons}

Remember, you should add these CSS styles to whatever stylesheet you use when displaying your entry form so that the formatting buttons will appear correctly.

Make Entry Sticky

The user can specify whether to make the entry "sticky" or not.

<p><input type="checkbox" name="sticky" value="y" {sticky} /> Make Entry Sticky</p>

Ping Servers

The user can any servers they wish to ping when the entry is submitted.

{ping_servers}
<p>Ping Servers<br />
{ping_row}
<input type="checkbox" name="ping[]" value="{ping_value}" {ping_checked} /> {ping_server_name}<br />
{/ping_row}
</p>
{/ping_servers}

Status Menu

The user can select the appropriate entry status for the entry.

{status_menu}
<p>Status<br />
<select name="status">
{select_options}
</select>
</p>
{/status_menu}

Title

The user can input the title for the entry.

<p>Title<br />
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" /></p>

URL Title

The user can specify the URL Title for the entry. By default, it will be dynamically created as the user types the title. If this field is not included or is left blank, then the URL Title will be created by ExpressionEngine based on the Title.

<p>URL Title<br />
<input type="text" name="url_title" id='url_title' value="{url_title}" maxlength="75" size="50" /></p>

Parameters

allow_comments=

allow_comments="yes"

If you don't wish to include the form option on the page then you can set whether or not to allow comments with the entry via this parameter. Options are "yes" and "no".

allow_trackbacks=

allow_trackbacks="yes"

If you don't wish to include the form option on the page then you can set whether or not to allow trackbacks with the entry via this parameter. Options are "yes" and "no".

category=

category="7|13"

If you don't wish to include the form option on the page then you can set any categories that you wish to assign the entry to via this parameter. Specify the category by Category ID. You may specify multiple categories by separating the Category ID with the pipe character:

category="3|7|13|42"

hidden_pings=

hidden_pings="yes"

If you don't wish to include the form options on the page to select the servers to ping, then you can specify whether or not to send the pings via this parameter. Options are "yes" and "no". If you select "yes", then EE will send a ping to all of the servers that are specified under Admin > Default Ping Servers.

preview=

preview="site/entry"

This parameter specifies the Template Group/Template to use for displaying the entry preview. Typically, it is easiest to specify the same Template being used for the entry form.

return=

return="site/index"

You may specify where to take the user after the entry has been submitted. Specify the Template Group/Template. This is a required parameter.

show_fields=

show_fields="body|extended"

If you wish, you may elect not to display all of the entry fields assigned to your weblog. This could be useful if you have fields that are only used for administrative purposes. Specify which fields to include by using their field name (the short name, not the label). You may specify multiple fields by separating their field names with the pipe character:

show_fields="body|extended|full_image"

You may exclude fields by placing the word "not" in front of the list:

show_fields="not image_thumbnail|source|rating"

Note: You must include all fields that are designated as "required".

status=

status="pending"

If you don't wish to include the form option on the page you can set the status that you wish to assign the entry to. Simply use the name of the status as specified under Admin > Custom Entry Statuses. The two statuses "open" and "closed" are default statuses that are always available, so you can always specify those if needed.

sticky_entry=

sticky_entry="yes"

If you don't wish to include the form option on the page then you can set whether or not to make the entry "sticky" via this parameter. Options are "yes" and "no".

use_live_url=

use_live_url="no"

By default, the URL Title field will be dynamically populated as you type your Title. If you do not wish to have that happen, you can turn off the feature using this parameter. Options are "yes" and "no".

weblog=

weblog="news"

The name (short name) of the weblog that the categories are assigned to. This is a required parameter.

Variables

The Stand Alone Entry Form also contains a few special variables.

field_instructions

{field_instructions}

The custom field instructions as entered in the custom fields edit screen.

smiley_url

{smileys_url}

The URL to the "smileys" palette. Smileys are often also called emoticons. This variable is typically used in a link of the form:

<a href="{smileys_url}" onclick="window.open(this.href, '_blank', 'width=600,height=440');return false;" onkeypress="this.onclick()">Smileys</a>
Added EE 1.3

upload_url

{upload_url}

The URL to the File Upload Utility. This variable is typically used in a link of the form:

<a href="{upload_url}" onclick="window.open(this.href, '_blank', 'width=400,height=600');return false;" onkeypress="this.onclick()">File Upload</a>

In order to use the File Upload Utility, the member must have access to the Control Panel since the upload form uses content from the Control Panel.

Added EE 1.3

Previewing

Within the main {exp:weblog:entry_form} tag, you may place a variable pair to allow you to display a preview of the entry.

{preview}
<h1>{title}</h1>

{display_custom_fields}

{/preview}

Displaying Custom Fields

There are two ways to display your custom field data in the preview. The first, and simplest, way is simply to use this variable:

{display_custom_fields}

That variable will automatically loop through and display all of the entry fields.

The other method is to individually specify the fields, just as you might when displaying an entry in a Template. For instance:

{preview}
<h2>{title}</h2>

{body}

<div class="more">{extended}</div>

{/preview}

You must specify the fields by their field name (short name) and not by their label.

Top of Page