Commenting -- Seeing Email Addresses and Selecting Collections

  1. Is there a way for administrators to view the email addresses of people using the Commenting plugin so that we can send them a personal response? The email address is a required field for people posting messages, but I can’t see that it comes through to the administration area where it can be used.

  2. Is there a way to turn on Commenting in only selected collections? Right now it seems as if it is either active to an entire site or inactive for the entire site. I would like to turn it on in only selected collections where I want feedback.

Paul Carnahan, Vermont Historical Society

1 Like

There’s not a way to do those directly, but some straightforward code hacking can do it.

  1. Open the views/admin/comment.php file, and just before the last closing div, add this line:
<div class='comment-email three columns omega'><?php echo $comment->author_email; ?></div>
  1. Open the CommentingPlugin.php file, and look for these lines:

    public function hookPublicCollectionsShow($args)
    {
        self::showComments($args);
    }

First, dig up the collection id like this:

$collection = $args['collection'];
$collectionId = $collection->id;

Then, check whether the id is one of the ones you want to show comments on


    public function hookPublicCollectionsShow($args)
    {

        $collection = $args['collection'];
        $collectionId = $collection->id;
        
        if ($collectionId == 1 || $collectionId == 2) {
              self::showComments($args);
        }
    }