This function allows you to check to see whether or not the currently logged in user is subscribed to a given tag.
{exp:tag:subscribed} content {/exp:tag:subscribed}
Parameters
The following parameters available for use:
marker=
marker="department"
It's possible to change the marker in the URI from the default of tag, to something of your choice. This parameter tells Tag:Entries which marker to look for in your URI. By default, Tag will check the URI for the marker tag, like this: http://www.site.com/articles/by_tag/tag/pants/
member_id=
member_id="{segment_3}"
By default, this function will show results for the currently logged in user. This parameter allows you to specify a member ID.
tag=
tag="{segment_3}"
This parameter is used to tell this function which tag to look at. This can be hardcoded, specified dynamically through the URI, or generated with the {tag} variable through another function.
tag_id=
tag_id="25"
This parameter is used to tell this function which tag to look at. This can be hardcoded, specified dynamically through the URI, or generated with the {tag_id} variable through another function.
Variables
The following variables are available for use:
subscribe_link
{subscribe_link}
This variable automatically 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 automatically 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>
Conditionals
The following conditionals are available for use:
if subscribed
{if subscribed}{/if}
This conditional allows you to output a message or content if a given member is subscribed to the tag being checked.
if not_subscribed
{if not_subscribed}{/if}
This conditional allows you to output a message or content if a given member is not subscribed to the tag being checked.
Examples
Below assumes usage on the Tag:Entries page and is a basic example of how you show different messages/content if a member is or is not subscribed to the given tag:
{exp:tag:subscribed tag="{segment_3}"}
{if subscribed}
<p>
You are Subscribed to this Tag!
<a href="{unsubscribe_link}">Unsubscribe?</a>
</p>
{/if}
{if not_subscribed}
<p><a href="{subscribe_link}">Subscribe to this Tag?</a></p>
{/if}
{/exp:tag:subscribed}