ExpressionEngine® User Guide

Legacy Documentation

You are using the documentation for version 4.3.8. Go here for the latest version.

Comment Subscriptions

Comment Subscriber List Tag

The Comment Subscriber List Tag enables you to display the members who have subscribed to comment notifications for a particular entry.

Note

The Comment Subscriber List Tag is intended for use in one of your “single entry” pages. That is, a page that shows a single, specific channel entry. Its variables are all prefixed, so you can easily use it inside of a channel entries tag or a comment entries tag.

Here is a basic example showing how you might use the Comment Subscriber List Tag:

{exp:comment:subscriber_list}
  {if subscriber_count == 1}
    <p>{subscriber_total_results} Subscribed</p>
    <ul>
  {/if}

  {if subscriber_is_member}
    <li><a href="{path='member/{subscriber_member_id}'}">{subscriber_screen_name}</a></li>
  {/if}

  {if subscriber_count == subscriber_total_results}
    <li>and {subscriber_guest_total} Guest{if subscriber_guest_total != 1}s{/if}</li>
    </ul>
  {/if}
{/exp:comment:subscriber_list}

Parameters

entry_id=

entry_id="24"

You can hard code the comment subscriber list tag to show subscribers for a specific channel entry by its entry ID.

Note

This parameter takes precedence over any entry specified dynamically in the URL, so when using this parameter you will want to make sure it is clear to the user which entry the displayed comments belong to.

exclude_guests=

exclude_guests="yes"

If you would like to exclude guest comments from the list and totals, set the exclude_guests parameter to “yes”. Comments made by non-members will not be included in the totals, and their email addresses will not be available for output to Super Admins.

Variables

subscriber_count

{subscriber_count}

The “count” out of the current subscriber being displayed by the tag. Also available simply as {count}, but using the prefixed version makes this variable safe to use inside of other tags that may have their own {count} variable.

subscriber_email

{subscriber_email}

The email address of the subscriber being displayed.

Note

For the privacy of your site’s members, email addresses will only be output to logged in Super Admins. This is useful for making this information known to administrators, e.g.:

{if subscriber_is_member}
 {subscriber_screen_name}
{if:else}
 {encode="{subscriber_email}"}
{/if}

{subscriber_email} will be empty if you are not logged in as a Super Admin so it is best to use this variable in a conditional.

subscriber_guest_total

{subscriber_guest_total}

The total number of subscribers to an entry who are not registered members of the site.

subscriber_member_id

{subscriber_member_id}

The member ID of the subscriber being displayed. This will be “0” if the subscriber is a guest, so it is best to use this variable in a conditional.

subscriber_member_total

{subscriber_member_total}

The total number of subscribers to an entry who are registered members of the site.

subscriber_screen_name

{subscriber_screen_name}

The screen name of the subscriber. This will be empty if the subscriber is a guest, so it is best to use this variable in a conditional.

subscriber_total_results

{subscriber_total_results}

The total number of subscribers to an entry. Also available simply as {total_results}, but using the prefixed version makes this variable safe to use inside of other tags that may have their own {total_results} variable.

Conditionals

subscriber_is_member

{if subscriber_is_member}

The conditional allows you to show (or hide) content based on whether the subscriber is a registered member of the site.