Expands comments module to also allow for reviewing of an object

Installs: 2 805

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 2


1.1.0 2021-08-24 13:45 UTC

This package is auto-updated.

Last update: 2023-02-24 17:09:48 UTC


Scrutinizer Code Quality

Add ability to review dataobjects by expanding on the core "comments" module

This module allows you to attach a "comments form" (and thread) to an object, in much the same way as the silverstripe-comments module, but the form adds a Rating field and you can customise the min and max values via SilverStripe config.


Install via composer:

composer require i-lateral/silverstripe-reviews


Adding reviews to an object is done in much the same way as the comments module. First you must add the extension, then you can customise any of the CommentsOptions.

For example, if I have a Product class (in the global namespace) then I would add the following to config.yml (note: you must also add the comments extension).

    - SilverStripe\Comments\Extensions\CommentsExtension # must be added first
    - ilateral\SilverStripe\Reviews\Extensions\ReviewsExtension

Once you have done this, you can customise options (such as min/max rating) as below:

    - SilverStripe\Comments\Extensions\CommentsExtension
    - ilateral\SilverStripe\Reviews\Extensions\ReviewsExtension
  # Customise comments options
    show_ratings: true # Disables ratings
    min_rating: 1 # Minimum rating possible
    max_rating: 5 # Maximum rating possible 
    enable_url: false # Re-show the URL field (hidden by default)

NOTE This module extends on the functionality of the comments module, so you still need to add the template variable to your Page/Controller template: