Tag Documentation

Tag:Tag_Name template tag

This template tag makes it easy for you to parse out a clean tag name in your page. It detects the tag(s) passed to it and in the case of multi-word tags, simply converts the space separator character to spaces. It also does capital case on all words. You would typically use this for a page heading on a page that is displaying entries that are assigned a specific tag (or set of tags). For example:

{exp:tag:tag_name}

Parameters

case=

case="lower"

This parameter allows you to control the case output of the tag name. Options are:

  • upper - ex: TAG NAME
  • lower - ex: tag name
  • title (default) - ex: Tag Name
  • sentence - ex: Tag name
  • none - outputs no case modification to the tag, but strips the websafe character from multi-word tags

tag=

tag="{segment_3}"

This parameter is required to parse the tag name. You can pass the tag through the URI (most common) or hard code a tag value. If hardcoding, to specify multiple tags, separate tags with the pipe character.

tag_separator=

tag_separator="_"

This parameter allows you to specify the character that separates multiple tags in the URI, in the event you're calling multiple tags in the URI. Default is comma (,), but if your site is set to force query strings, EE won't let you have commas in the URI.

websafe_separator=

websafe_separator="-"

This parameter allows you to control the websafe separator character for multi-word tags in the URI. Allowable characters are +, -, and _. The default is +. Be sure to use this parameter consistently throughout your site if you change from the default value of +. For example, if you're linking from your Tag cloud to your Tag:Entries page with - as your websafe separator, you'll need to add this same parameter with - as the value for your Tag:Entries page. Otherwise results will NOT show correctly.

Examples

This example would be used in the event you want Tag to automatically pull the currently active tag(s). A primary situation in which you would use this would be on a Tag Entries page to display the tag being listed:

<h2>
    Viewing all entries tagged with:
    {exp:tag:tag_name
        tag="{segment_3}"
        case="title"
    }
</h2>

If you have multiple Tags in the URL (which might look something like this:

https://site.com/entries/black+pants,nachos,tacos/

The above code would output it as:

Black Pants, Nachos, Tacos

Support

Having problems setting up and/or using Tag? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.