Favorites 2.5 Rank
The Favorites:Rank loop shows and ranks weblog entries by the amount of times they've been saved to Favorites by members.
{exp:favorites:rank} content {/exp:favorites:rank}
Parameters
Most of the parameters available in the Weblog:Entries loop are available here. Additionally, these exist as well:
favorites_start_on=
favorites_start_on="2008-09-05 12:00 PM"
You can specify a particular date/time on which to start the entries. Only entries that were saved to Favorites on or after this date will be included in the display. This parameter is often used together with the 'favorites_stop_before' parameter for limiting the entry display to a specific date range.
favorites_stop_before=
favorites_stop_before="2008-09-12 12:00 PM"
You can specify a particular date/time on which to end the entries. Only entries that were saved to Favorites before this date will be included in the display (entries exactly on this date/time will not be included). This parameter is often used together with the 'favorites_start_on' parameter for limiting the entry display to a specific date range.
orderby=
orderby="favorites_date"
The 'orderby' parameter sets the display order of the entries. You can use any of the options available with Weblog:Entries, or additionally you can use 'favorites_date' or 'count'.
show_unfavorited=
show_unfavorited="yes"
Setting the 'show_unfavorited' parameter to "yes" will display weblog entries that have not yet been saved to any member's Favorites. By using both show_unfavorited="yes" and show_favorites="no", you can show ONLY entries not saved to any member's Favorites. Default value is "no".
show_favorites=
show_favorites="no"
Setting the 'show_favorites' parameter to "no" will filter out all weblog entries that have been saved to any member's Favorites. By using both show_unfavorited="yes" and show_favorites="no", you can show ONLY entries not saved to any member's Favorites. Default value is "yes".
sort=
sort="asc"
The sort order can be ascending or descending. The order will default to "descending" if nothing is specified.
Variables
Most of the variables available in the Weblog:Entries loop are available here. Additionally, these exist as well:
favorites_date
{favorites_date format="%l, %F %j, %Y at %g:%i %a"}
The 'favorites_date' variable displays the date/time that the given entry was last saved to a member's Favorites. This requires the "format" parameter in order to define how the date should be displayed.
Conditionals
Most of the conditionals available in the Weblog:Entries loop are available here.
Examples
Below is a simple example of how to display a list of weblog entries saved to Favorites, ranked in order of times they’ve been saved to Favorites, with Pagination, and using the Favorites:Count loop to display total times the entry has been saved to Favorites:
{exp:favorites:rank orderby="count" sort="desc" limit="5" pagination="bottom"}
<h2>[{exp:favorites:entry_count entry_id="{entry_id}"}{favorites_count}{/exp:favorites:entry_count}] <a href="{title_permalink="favorites/entry"}">{title}</a></h2>
<p>Entry lasted saved to Favorites on: {favorites_date format="%Y-%m-%d %g:%i %A"}</p>
{paginate}
<p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}
{/exp:favorites:rank}
Below is an example of how to display a list of weblog entries that have not been saved to Favorites:
{exp:favorites:rank limit="10" pagination="bottom" show_unfavorited="yes" show_favorites="no"}
<h2><a href="{title_permalink="favorites/entry"}">{title}</a></h2>
{paginate}
<p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}
{/exp:favorites:rank}