TransWikia.com

How to have separate private comments for nodes apart from the general comments?

Drupal Answers Asked by quest on February 6, 2021

I have a specific requirement.
Apart from the general comments which everyone can view or post for my custom node I also require private comments thread which will be shared only by the node created user and selected few.
Using the same comments form will not work as it will be viewed by all.
Any inputs on achieving this?

Thanks.

2 Answers

If you are up for a bit of code you can try the following approach,

Create a content type "private comments", it will have the title and body field that you need by default, you need to add a node reference field to the content type on which you want this private comments enabled. Now you need to create a block that will render the node add form for this content type. You can then enable this block where you want your private comments.

On the submit function, the title and body will be saved by Drupal, you need to add a submit handler so that the reference between your content type and comments is saved.

The advantage of creating a content type is you will get integration with views and you can then show your comments anywhere.

Answered by Kimi on February 6, 2021

For Drupal 7 see the Reply module. It lets you create your own set of "comments" attached to any Entities you want.

With some custom code you could limit the field to a specific user role or set of users. Be sure to read the README in the module.

Answered by tenken on February 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP