Favorites Documentation

Favorites:Count template tag

The Favorites:Count will display the number of times the channel entry or member has been saved as a favorite by users.

{exp:favorites:count}

Parameters

The following parameters are available for use:

collection=

collection="articles"

This parameter allows you to additionally filter the count by favorites that occurred for a specific collection name. Specify multiples with the pipe character.

entry_id

entry_id="{entry_id}"

Required, unless using member_id/username. Specify a channel entry ID for this parameter and it will parse this tag as the total number of favorites for the given entry. This parameter can be hardcoded, set dynamically, or by having an entry ID passed through an embedded template.

member_id

member_id="{segment_3}"

Required, unless using entry_id or username. Specify a member ID for this parameter and it will parse this tag as the total number of favorites for the given member. This parameter can be hardcoded, set dynamically, or by having a member ID passed through an embedded template.

username

username="{segment_3}"

Required, unless using entry_id or member_id. Specify a username for this parameter and it will parse this tag as the total number of favorites for the given member. This parameter can be hardcoded, set dynamically, or by having a username passed through an embedded template.

favorites_member_id

favorites_member_id="{segment_3}"

This parameter allows you to filter the Favorites count down to a specific member. It's typically used to display the total number of entries and/or members a user has saved to their favorites. This parameter can be hardcoded, set dynamically, or by having a member ID passed through an embedded template.

favorites_username

favorites_username="{segment_3}"

This parameter allows you to filter the Favorites count down to a specific member. It's typically used to display the total number of entries and/or members a user has saved to their favorites. This parameter can be hardcoded, set dynamically, or by having a username passed through an embedded template.

type

type="entry"

This parameter allows you to filter down the total number of Favorites by types. Options are entry and member. If this parameter is NOT specified, it'll show results for both entries and members. Typically used in conjunction with the favorites_member_id and favorites_username parameters, to show the total amount of favorites a given member has saved. This parameter is NOT used when displaying total number of times an entry or member has been saved to favorites - Favorites automatically assumed to filter by the correct type when it's fed a member ID, username or entry ID.

Examples

Below is a simple example of how you would put this tag into use on a single entry page.

{exp:channel:entries
    require_entry="yes"
}
    <h2>{title}</h2>
    <p>{body}</p>
    <p>
        This entry has been saved to favorites
        {exp:favorites:count entry_id="{entry_id}"} times.
    </p>
{/exp:channel:entries}

Support

Having problems setting up and/or using Favorites? 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.