This function allows your visitors to submit tags to a channel entry. When tags are submitted, they are directly applied to that channel entry.

{exp:tag:form} content {/exp:tag:form} 

Parameters

The following parameters are available for use:

entry_id=

entry_id="{entry_id}" 

The Tag:Form function will normally detect the entry dynamically in the URI when viewing a single entry page. However, if you wish to use this on a multiple entry page, and/or use embeds, this parameter is available for use.

form_id=

form_id="your_form" 

This parameter allows you to declare a form ID attribute for the form. Popular usages for this are for Javascript or CSS.

form_name=

form_name="your_form" 

This parameter allows you to declare a form name attribute for the form. Popular usages for this are for Javascript or CSS.

return=

return="template_group/template" 

This 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.

tag_group_id=

tag_group_id="3" 

This parameter allows you to specify which tag group you wish to apply the submitted tags to. Specify the unique ID of the Tag group. This is only really necessary if you have more than 1 Tag group.

tag_group_name=

tag_group_name="group1|group2" 

This parameter allows you to specify which tag group you wish to apply the submitted tags to. Specify the short name of the Tag group. This is only really necessary if you have more than 1 Tag group.

Variables

The following variables are available for use:

tag_widget

{tag_widget} 

You can collect tags for entries from users by using the tags form field, or by using this variable. This variable will parse out as a limited Tag widget. It will just display an input field with autosuggest, and the currently assigned tags. It will not display the Top Tags or Suggest Tags features like it does for the Channel Form. It is important that you include a call to jQuery in the template as well.

Form Fields

The following variables are available for use:

tags

<textarea name="tags"><textarea> 

You can use the tag_widget to collect tags for entries from users, or by using this field. Make sure you let your users know how to delimit their tags. If you use spaces, commas or line breaks between tags (setting in Tag CP), let your users know.

Examples

Below is an example of how to add a Tag Form with Tag widget in an single entry view template:

<html>
    <head>
        <title>Llama Husbandry</title>
        <script
            type="text/javascript"
            src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
        </script>
    </head>
<body>

{exp:channel:entries require_entry="yes"}

<h2>{title}</h2>
<p>{body}</p>

{exp:tag:form
    form_id="my_form"
    return="path_to/my_template"
}

    <h4>Add your own Tags</h4>
    <p>{tag_widget}</p>
    <p><input type="submit" name="submit" value="Submit Tags" /></p>

{/exp:tag:form}

{/exp:channel:entries}

</body>
</html>

Below is an example of how to add a Tag Form with text area field in an single entry view template:

{exp:tag:form
    form_id="my_form"
    return="path_to/my_template"
}

    <h4>Add your own Tags</h4>
    <p>Please add each Tag on a separate line.</p>
    <p><textarea name="tags" cols="50" rows="5"></textarea></p>
    <p><input type="submit" name="submit" value="Submit Tags" /></p>

{/exp:tag:form}