Favorites Documentation

Collections Template Tags

Favorites:Collections template tag

The Favorites:Collections tag is used to display collections.

{exp:favorites:collections} content {/exp:favorites:collections}

Parameters

The following parameters are available for use:

limit

limit="5"

This parameter lets you limit the number of results displayed on the list.

paginate=

paginate="both"

This parameter allows you to control where the pagination will display. Options are top, bottom, or both. Used in conjunction with the favorites:paginate variable pair.

type=

type="entry"

This parameter sets which kind of collection to create. There are 2 options for the type parameter:

  • entry (default) - for collections used with channel entries
  • member - for collections used with members

Variables

The following variables are available:

favorites:collection_id

{favorites:collection_id}

This variable outputs the ID of the collection.

favorites:collection_name

{favorites:collection_name}

This variable outputs the name of the collection.

Variable Pairs

The following variable pairs are available for use:

favorites:paginate

{favorites:paginate}
    Page {favorites:current_page} of {favorites:total_pages} pages
    {favorites:pagination_links}
{/favorites:paginate}

OR

{favorites:paginate}
    <ul class="pagination">
    {favorites:pagination_links}
        {first_page}
            <li><a href="{pagination_url}">First</a></li>
        {/first_page}
        {previous_page}
            <li><a href="{pagination_url}">&laquo; Previous</a></li>
        {/previous_page}
        {page}
            <li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
        {/page}
        {next_page}
            <li><a href="{pagination_url}">Next &raquo;</a></li>
        {/next_page}
        {last_page}
            <li><a href="{pagination_url}">Last</a></li>
        {/last_page}
    {/favorites:pagination_links}
    </ul>
{/favorites:paginate}

Pagination is available for this tag and works just like regular EE pagination, but each variable/variable pair is prepended with favorites: (except for any variables and variable pairs inside of the favorites:pagination_links variable pair). Used in conjunction with the paginate parameter.

Conditionals

favorites:no_results

{if favorites:no_results}
    Sorry, there are no results.
{/if}

This conditional shows its contents when there are no collections found under the given parameters.

Examples

The following lists all channel entry collections:

<ul>
{exp:favorites:collections
    type="entry"
}
    <li>{favorites:collection_name}</li>
    {if favorites:no_results}
        <li>No collections found</li>
    {/if}
{/exp:favorites:collections}
</ul>

The following lists all member collections:

<ul>
{exp:favorites:collections
    type="member"
}
    <li>{favorites:collection_name}</li>
    {if favorites:no_results}
        <li>No collections found</li>
    {/if}
{/exp:favorites:collections}
</ul>

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.