This function allows you to display a list of all tags a given member have subscribed to. With usage of Tag:Entries function, you can display channel entries that have been tagged with the tags a member has subscribed to.

{exp:tag:subscriptions} content {/exp:tag:subscriptions} 

Parameters

The following parameters are available for use:

backspace=

backspace="2" 

This parameter will remove the specified amount of characters from the ending of your results. A typical usage for this would be to remove the last comma, should you choose to seperate your tags by commas.

exclude=

exclude="pretzels|mitchell" 

This parameter allows you to exclude tags from the list by the tag name. For multiples, separate by pipe character. Additionally, to exclude "LIKE" tags, use the % symbol as a wildcard. For example, exclude="%dog" would exclude the sled dog tag.

limit=

limit="10" 

You can limit the number of tags returned by using this parameter.

member_id=

member_id="{segment_3}" 

This parameter allows you to specify a member ID. If you do not specify this parameter, it will show results for currently logged in member.

orderby=

orderby="clicks" 

This parameter allows you to order your tags by the method you wish. Available methods are: count, clicks, total_entries, tag_name, and random. Default method is tag_name.

sort=

sort="asc" 

This parameter allows you to sort tags by ascending (asc) or descending (desc) order. Default is desc.

tag_group_id=

tag_group_id="3" 

This parameter allows you to narrow down or filter the tag results in the list by specifying the tag group ID. Seperate multiples with the pipe character.

tag_group_name=

tag_group_name="group1|group2" 

This parameter allows you to narrow down or filter the tag results in the list by specifying the tag group short name. Seperate multiples with the pipe character.

websafe_separator=

websafe_separator="-" 

This parameter allows you to control the websafe separator character for multi-word tags generated by the websafe_tag variable. 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 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.

Variables

The following variables are available for use:

clicks

{clicks} 

This variable will return the number of times each tag has been "clicked" (viewed in Tag:Entries loop).

count

{count} 

This variable will return the total number of instances of each tag across channel entries, within the specified parameters. For example, specifying the status parameter would affect the count on this variable.

subscribe_link

{subscribe_link} 

This variable generates a URL for subscribing to a tag. You can additionally add &return= to the URL to control the return path after the confirmation message page. An example could look like this:

<a href="{subscribe_link}&return=template_group/template">Subscribe</a> 

unsubscribe_link

{unsubscribe_link} 

This variable generates a URL for unsubscribing from a tag. You can additionally add &return= to the URL to control the return path after the confirmation message page. An example could look like this:

<a href="{unsubscribe_link}&return=template_group/template">Unsubscribe</a> 

tag

{tag} 

This variable returns the tag name.

tag_id

{tag_id} 

This variable parses the ID of a given tag. This variable would normally be used when creating a link for the tag, and if your tags contain special and/or foreign characters that would cause trouble being placed in the URI.

total_entries

{total_entries} 

This variable shows the total number of channel entries that are assigned to each tag.

total_results

{total_results} 

This variable will return the total amount of tags results being displayed. You would typically use this in a conditional statement.

websafe_tag

{websafe_tag} 

This variable will be replaced by a tag name where spaces have been replaced by plus signs (+). This makes the tags more safe to place in a URL and for compatibility with web apps like Reddit. You can also change the websafe seperator character by using the websafe_separator parameter.

Conditionals

The following conditionals are available for use:

if no_tag_results

{if no_tag_results}{/if} 

This conditional allows you to output a message if a specified member has no subscriptions to any tags.

Examples

The below is a basic example of how you show the tags a member is subscribed to:

<ul>
    {exp:tag:subscriptions
        orderby="tag_name"
        sort="asc"
    }
        <li><a href="{path='articles/by_tag/tag'}/{websafe_tag}">{tag}</a></li>
    {/exp:tag:subscriptions}
</ul>

An more extensive example, which includes outputting channel entries that are tagged with the tag(s) subscribed to, could look like this:

{exp:tag:subscriptions
    orderby="tag_name"
    sort="asc"
}

    <h3>Entries for {tag} (<a href="{unsubscribe_link}&return=template_group/template">Unsubscribe from this Tag</a>)</h3>

    <ul>
        {exp:tag:entries tag="{tag}" orderby="entry_date" sort="asc" limit="10"}
        <li><a href="{url_title_path="articles/entry"}">{title}</a></li>
        {/exp:tag:entries}
    </ul>

{/exp:tag:subscriptions}