i-lateral/silverstripe-reviews
Composer 安装命令:
composer require i-lateral/silverstripe-reviews
包简介
Expands comments module to also allow for reviewing of an object
README 文档
README
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.
Installation
Install via composer:
composer require i-lateral/silverstripe-reviews
Usage
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).
Product: extensions: - 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:
Product: extensions: - SilverStripe\Comments\Extensions\CommentsExtension - ilateral\SilverStripe\Reviews\Extensions\ReviewsExtension # Customise comments options comments: 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:
$CommentsForm
统计信息
- 总下载量: 3.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-08-07