2017 © Pedro Peláez
 

silverstripe-module silverstripe-flagcomments

Allow users to flag comments

image

micmania1/silverstripe-flagcomments

Allow users to flag comments

  • Friday, July 29, 2016
  • by micmania1
  • Repository
  • 2 Watchers
  • 0 Stars
  • 699 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 9 % Grown

The README.md

Flag Comments

This module extends the comments module core functionality and adds the ability for a front-end user to flag a comment., (*1)

When a comment has been flagged, it cannot be flagged by anyone else., (*2)

Requirements

  • silverstripe/comments ^3.1
  • silverstripe/framework ^4.0

Note: This branch is compatible with SilverStripe 4. For a SilverStripe 3 release, please see the 1.x release line., (*3)

Installation

composer require nzta/silverstripe-flagcomments, (*4)

Configuration

Assuming you've already added comments to your page as per instructions than all you need to do is enable flagging via config and add the flag to your template., (*5)

SilverStripe\CMS\Model\SiteTree:
  extensions:
    - 'NZTA\FlagComments\Extensions\FlagCommentsExtension'
  comments:
    can_flag: true

Adding the flag to your template:, (*6)

The endpoint expects an ajax request and only responds with JSON. You'll have to handle this yourself, but to add the flag to your HTML you need to edit the CommentInterface_singlecomment.ss template. There's no reason why you can't add this to another template (this is just a helping hand)., (*7)

<% if $canFlag %>
    <a href="$FlagLink">Flag</a>
<% end_if %>

The Versions

29/07 2016

dev-master

9999999-dev

Allow users to flag comments

  Sources   Download

The Requires

 

by Avatar micmania1