Open marksimons opened 5 years ago
Hi Mark, here's the full documentation for sorting by highest rated...
https://www.doublesecretagency.com/plugins/star-ratings/docs/sort-by-highest-rated
In your case, you're looking for something like this...
{% set params = { section: 'features', limit: 11, relatedTo: category } %}
{% set allNewsItems = craft.entries(params) %}
{% do craft.starRatings.sort(allNewsItems) %}
{% paginate allNewsItems as pageInfo, newsEntries %}
{% for entry in newsEntries %}
Hope that helps!
Hi, thanks for getting back to me.
I may be confused by your example but how could I adapt that to display entries by certain rating criteria. I don’t simoly want to display the highest rated content.
For example From a drop down that a user can select “view 3 star rated content only” in which case I would display content that has a rating of 3 stars. Thanks again.
Is it possible to get all entries from a section and then order them by the rating? The end goal is to have a dropdown where users can select to view only 3 star rated content, or only 5 star rated content etc..
My code at the moment returns the entries but I am unsure of how to sort them by rating.