Star Ratings

Documentation  •  Changelog


Sort by highest rated

You can sort your results to display the highest rated elements first!

Fetch your Element Criteria Model just as you normally would, then pass the Element Criteria Model into the sort method.

{% set hotels = craft.entries.section('hotels') %}

{% do craft.starRatings.sort(hotels) %}

If you want to sort by a specific key, simply add it as the second parameter...

{% do craft.starRatings.sort(hotels, 'comfortable') %}

Star ratings can be assigned to any valid element type, whether it's native or 3rd party.