Getting Rankings

Also provided are a collection of template tags for getting community rankings of products. i.e. Their popularity within certain actions. Thing like most bought or best rated products. All these template tags share the same syntax:

{% <ranking_type> [time_range "ALL"] [max_results 15] [requested_item_type "ITEM"] %}

Each template tag provides a list of rankings in the same way as the recommendation tags. e.g. a dictionary containing a product object, and a tracking url.:

    "product": <Product>,
    "tracking_url": ""

If no recommendations are found then an empty list is returned.

Rankings Template Tags


Returns the most viewed products


Provides the most purchased items


Products with the most rating. This is not the best rated products, but those that have the greatest number of ratings in total, high or low.


The products with the best ratings.


The products with the worst rated over all.


{% load rankings %}

{% most_viewed as rankings %}
{% for item in rankings %}
        <a href="{{ item.tracking_url }}">
            {{ item.product.title }}
{% endfor %}


Permitted values for some of the optional parameters or more obvious than other so here they are explained:

The range over which you want the ranking. Options include: “DAY”, “WEEK”, “MONTH”, “ALL”. The default is “ALL”
The maximum number of products you want. The default is up to 15
The item type you want in the results. The default is “ITEM”