diff --git a/docs/en/Configuration.md b/docs/en/Configuration.md index 902e54f..31ee4de 100644 --- a/docs/en/Configuration.md +++ b/docs/en/Configuration.md @@ -1 +1,28 @@ -## Configuration \ No newline at end of file +## Configuration + +The module provides a number of built in configuration settings below are the default settings + + // mysite/_config.php + + Commenting::add('Foo', array( + 'require_login' => false, + 'required_permission' => false, + 'use_ajax_commenting' => true, + 'show_comments_when_disabled' => false, + 'order_comments_by' => "\"Created\" DESC", + 'comments_per_page' => 10, + 'comments_holder_id' => "comments-holder", + 'comment_permalink_prefix' => "comment-", + 'require_moderation' => false + ); + +If you want to customize any of the configuration options after you have added the extension (or +on the built-in SiteTree commenting) use `set_config_value` + + // mysite/_config.php - Sets require_login to true for all pages + Commenting::set_config_value('SiteTree', 'require_login', true); + + // mysite/_config.php - Returns the setting + Commenting::get_config_value('SiteTree', 'require_login'); + + \ No newline at end of file diff --git a/docs/en/Extending-The-Comments-Form.md b/docs/en/Extending-The-Comments-Form.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/en/Installing.md b/docs/en/Installing.md index 02650d8..b915a66 100644 --- a/docs/en/Installing.md +++ b/docs/en/Installing.md @@ -12,8 +12,38 @@ columns and tables for the module to function. If you previously had SilverStripe 2.4 installed then you will also need to run the migration script provided. More information on this is in the next section -## Migrating old comments +## Enabling Commenting + +Out of the box the module adds commenting support to all pages on your site. This functionality can be +turned on and off on a per page basis in the CMS under the `Behaviour` tab for a given page. Once the `Allow Comments` +checkbox is ticked republish the page and view the webpage. + +Ensure that your template file (usually themes/yourtheme/templates/Layout/Page.ss) has the `$CommentsForm` variable +where you want comments to appear. + +To enable commenting on other objects (such as your own subclasses of DataObject) add the following +to your `mysite/_config.php` file. + + // Adds commenting to the class Foo + Commenting::add('Foo'); + +You can also pass configuration options to the add function to customize commenting on that object. Again +in your `mysite/_config.php` file replace the previous line with the following + + // Adds commenting to the class Foo but requires you login and comments + // are moderated + Commenting::add('Foo', array( + 'require_moderation' => true, + 'require_login' => true + )); + +For more configuration options see [Configuration](Configuration.md). + +## Upgrading + +### Migrating from 2.* SilverStripe installations This module replaces the built in commenting system available in versions up to SilverStripe 2.4. To migrate from -that you need to run the `InitialCommentMigration` task. You can do this via sake or via a web browser by visiting -*http://yoursite.com/dev/tasks/InitialCommentMigration* \ No newline at end of file +that you need to run `dev/build` after installing the module. + +You can do this via sake (`sake dev/build`) or via a web browser by visiting http://yoursite.com/dev/build \ No newline at end of file