About Ratings

Adds Ratings to Pages.

Category 1Development Tools
Modules that have more to do with assisting development of a site rather than managing its content.
Category 2Other Modules
Modules that have a unique purpose not covered by existing categories.
Release StateStable
Should be safe for use in production environments. *
Authorconclurer
Module Version1.1.0
Class NamePageRatings
Compatibility2.5, 2.6, 2.7
Date AddedOctober 8, 2014
Last UpdatedOctober 11, 2014
Recommended ByNew recommendations may take up to 1 day to appear.

Instructions

This module's files should be placed in /site/modules/PageRatings/
How to install or uninstall modules

README

Page Ratings

This module for provides a simple API for storing user ratings for pages.

Ratings API

You can access the Ratings API via the $page->ratings property.

This includes the following methods:

  • $page->ratings->count the amount of votes on this page
  • $page->ratings->average the average of all votes on this page
  • $page->ratings->current the current user's rating on this page, 0 if the user hasn't rated this page yet
  • $page->ratings->hasVoted returns true if the current user has already voted on this page
  • $page->ratings->reset() will reset all ratings
  • $page->ratings->add($rating) will add an rating from the current user on this page. The rating must be an integer between 1 and 5.

Translation

The module includes a German translation. Please add the language file to your German language in ProcessWire.

Comments

  • Far4599

    Far4599 3 years ago 31

    I have implemented your module. How can I arrange pages sorting according to their ratings with your module?

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.