Tag 2.1 Form

The tag form allows your users to tag weblog or gallery entries on your site similar to how they would comment on entries. When users submit tags, those tags are added to the Tag module database.

Parameters

entry_id

entry_id = "some_entry_id"

The 'entry_id' parameter allows you to override the entry id or url title pulled from the url of the page. In those cases where your page shows a number of weblog entries, each of which you want to accept tags, you should supply this parameter by feeding into it the entry_id variable from your weblog:entries tag. Like this entry_id="{entry_id}".

form_id

form_id = "some_form_id"

The 'form_id' parameter allows you to declare an id for your form.

form_name

form_name = "some_form_name"

The 'form_name' parameter is used to establish the name and id of the tag form. This will allow you to use javascript on the form.

return

return = "template_group/template"

The 'return' parameter establishes where users will be sent upon form submission. By default, if this parameter is not provided, users will be returned to the same page.

type

type = "gallery"

You can accept tags for either weblog or gallery entries. By default it is assumed that weblog entries are being tagged. But you can override this by setting the 'type' parameter to 'gallery'.

Form Fields

One field is used with the tag form. It is called 'tags'.

tags

<textarea name="tags"><textarea>

The 'tags' field is used to collect tags submitted by users. Make sure you let your users know how to delimit their tags. If you use spaces or line breaks or whatever as a delimiter between tags, let people know.

Examples


{exp:tag:form form_name="some_form_name" return="template_group/template"}

<div class="tag_form">

<h4>Add your own tags</h4>

<div class="small">Each tag on a separate line</div>

<p><textarea name="tags" cols="50" rows="4"></textarea></p>

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

</div>

{/exp:tag:form}