Gallery Extended 1.0 Entry Form

Parameters

There are two parameters available for the gallery_extended tag.

{exp:gallery_extended:entry_form gallery_name="Gallery" redirect="my/template"}

In the above example, the image submitted will be added to the gallery called "Gallery." Upon successful submission of their image, users will be redirected to the weblog/success template.

gallery_name=

gallery_name="Gallery"

The 'gallery_name' parameter is used by Gallery Extended to assign the user-uploaded image to the appropriate gallery.

NOTE: You can use the full name or short name of your gallery in this parameter.

redirect =

redirect ="my/template"

The 'redirect' parameter determines where to send users once they have submitted their image.

Variable Pairs

The following variable pairs are available with the {exp:gallery_extended:entry_form} tag.

category_menu

<select name='cat_id' class='select' > {category_menu} <option value='{cat_id}'>{cat_name}</option> {/category_menu} </select>

Use the category_menu variable pair to allow the user to assign their image to a category.

Form Fields

The following form fields can be used inside the {exp:gallery_extended:entry_form} tag.

title

<input type="text" name="title" value="" />

The 'title' field stores the title the user enters for their image.

userfile

<input type="file" name="userfile" size="20" />

The 'userfile' field will store the file name and upload location of the user's image file.

caption

<input type="text" name="caption" value="" />

The 'caption' field stores the caption the user enters for their image.

entry_date

<input type="text" name="entry_date" value="" />

The 'entry_date' field stores the date of the image entry.

status

<input type="text" name="status" value="" />

The 'status' field stores the status of the image entry. Note that open and closed are the only allowed values for the status field.

allow_comments

<input type="text" name="allow_comments" value="y" />

The 'allow_comments' field stores the permission of the user to allow comments on the image entry. Only y and n are valid values of the field.

custom_field_one

Up to six custom fields can be stored (as set in your gallery preferences), with the following syntax:

<input type="text" name="custom_field_one" value="" /> <input type="text" name="custom_field_two" value="" /> <input type="text" name="custom_field_three" value="" /> <input type="text" name="custom_field_four" value="" /> <input type="text" name="custom_field_five" value="" /> <input type="text" name="custom_field_six" value="" />

Examples

Following is an example of a form using the {exp:gallery_extended:entry_form} tag.

{exp:gallery_extended:entry_form gallery_name="Gallery" redirect="weblog"}

<div class=’defaultBold’ ><span class=’alert’>*</span>
File Name</div>

<input type="file" name="userfile" size="20" />  

<div class=’defaultBold’ ><span class=’alert’>*</span>
Entry Title</div>

<input type="text" name="title" value="” />

<div class=’itemWrapper’ >
<div class=’defaultBold’ ><span class=’alert’>*</span>
Entry Date</div>
</div>

<input style=’width:150px’ type=’text’ name=’entry_date’ id=’entry_date’ value=’{current_time format="%Y-%m-%d %h:%i %A"}’ size=’15’ maxlength=’22’ class=’input’ />

<div class=’defaultBold’ ><span class=’alert’>*</span>
Category</div>

<select name=’cat_id’ class=’select’ >
{category_menu}
<option value=’{cat_id}’>{cat_name}</option>
{/category_menu}
</select>

<div class=’defaultBold’ ><span class=’alert’>*</span>
Status</div>

<select name=’status’ class=’select’ >
<option value=’o’ selected=’selected’>Open</option>
<option value=’c’>Closed</option>
</select>

<div class=’defaultBold’ >Allow Comments</div>

<input class=’checkbox’ type=’checkbox’ name=’allow_comments’ value=’y’ checked=’checked’ />

<div class=’defaultBold’ >Caption</div>
<input type="text" name="caption" value="” />

<div class=’tablePad’ ><br /> <span class=’alert’>*</span><span class=’default’>  Indicates required fields</span>
<br /><br />  
<input type=’submit’ class=’submit’ value=’Submit New Entry’ />
<br /><br /></div>

{/exp:gallery_extended:entry_form}