ExpressionEngine Add-ons

Rating:Rank template tag

The Rating:Rank loop allows you to display a list of channel entries ordered by their rating stats. In other words, you can show a list of your highest rated channel entries with this function.

{exp:rating:rank} content {/exp:rating:rank}

Parameters

Most of the parameters available in the Channel:Entries loop are available here. Additionally, these exist as well:

bayesian_average_score=

bayesian_average_score="2.5"

Used in conjunction with the orderby parameter when set to Bayesian weighting method mode. This parameter allows you manipulate the overall site average rating value that is calculated by Rating. It's very possible that your site average rating value could be above or below what you might consider a "middle" value of 2.5. You can override this part of the Bayesian calculation and specify any value you wish. For example, if you felt that the middle value should be 2.5, simply enter that value in the parameter. If you wanted EVERY value of your Rating scale to be positive (as opposed to 2.5 and up being positive, and 2.5 and below being negative), you could specify a value of 0.

category=

category="1|4"

This parameter allows you filter your list of channel entries by the specified categories. Separate multiples with pipe character.

collection=

collection="Shark Reviews"

Rating allows you to dynamically sort ratings into groups at submission. This is done by specifying the collection parameter on your Rating:Form. To filter ratings by one of those groups, just specify this parameter for your Rating:Rank loop.

display_unrated=

display_unrated="yes"

This parameter allows you to have entries that have not yet been rated, included in the results. These unrated entries will have no rank value and if ordered by any Rating field or overall, will display AFTER entries that have been rated.

fractions=

fractions="."

This parameter allows you to specify which character to use to indicate fractions in numeric ratings. The default is a period (.).

limit=

limit="20"

This parameter controls how many results will be outputted. The limit will default to 100 entries if a value is not specified.

orderby=

orderby="YOUR_RATING_FIELD"
orderby="bayesian:YOUR_RATING_FIELD"

This parameter sets the display order of the entries. You can use all numeric rating field names or overall for this parameter.

Additionally, you can use Bayesian (weighted) method of ranking your entries. It makes some calculations on your site and weights the entries a little differently. For example, an entry with an average rating of 4.6/5 from 30 rating submissions would likely be ranked higher than that of an entry with average rating of 5/5 from 3 rating submissions. You can also use all numeric rating field names or overall for this parameter with Bayesian (weighted) method.

The Bayesian method looks at ALL ratings in the results, determines the average for ALL ratings, and sets that as the middle point. To manipulate this average value, see the bayesian_average_score parameter. Any averages above that is considered a positive rating, and anything below it is considered a negative rating. So if the overall average rating value for your results in 2.73/5, an entry with an average rating of 4.7/5 from 3 rating submissions would be ranked higher than that of an entry with average rating of 5/5 from 1 rating submission. And an entry with an average rating of 1.5/5 from 2 rating submissions would be ranked lower than that of an entry with an average rating of 1/5 from 1 rating submission.

precision=

precision="2"

This parameter allows you to specify to the number of decimals to round fractions for averages and totals on stats of numeric ratings. The default is 0.

rating_status=

rating_status="open|Pending|Custom"

This parameter allows you to filter ratings by their status. By default, it will only show ratings that are open. To specify multiple statuses, use the pipe (|) chracter.

sort=

sort="asc"

The sort order can be ascending or descending. The order will default to descending (desc) if nothing is specified.

thousands=

thousands=","

This parameter allows you to specify the character to use to separate groups of thousands in numerical rating fields. The default is a comma (,).

Variables

Most of the variables available in the Channel:Entries loop are available here.

Variable Pairs

Most of the variable pairs available in the Channel:Entries loop are available here.

Conditionals

Most of the conditionals available in the Channel:Entries loop are available here.

Examples

The following example will display a list of the Top Ten channel entries, with the assistance of the Rating:Stats loop to output the scores for each entry:

<h3>Top 10 Rated Entries</h3>

<ul>
{exp:rating:rank
    orderby="bayesian:rating"
    limit="10"
}
    <li>
        {exp:rating:stats
            entry_id="{entry_id}"
            precision="1"
        }
            {stars_avg_rating} ({avg_rating}/5)
        {/exp:rating:stats}
        <a href="{url_title_path='blog/article'}/">{title}</a>
    </li>
{/exp:rating:rank}
<ul>