Everything that’s Changed With Comments in Drupal 8

Everything that's Changed With Comments in Drupal 8

Comments were one of the more basic features in Drupal 7. There was only one type of comment and you had very limited modification and moderation options.

In Drupal 8, comments are vastly better. Here are 4 ways that comments have changed and improved:

#1. Comments are fields

In Drupal 8, you add comments as fields. This allows you to be more flexible with where comments are displayed on a page. It also allows comments to go anywhere that fields are allowed (not just on content).

#2. Comments have types

In Drupal 8, you can have more than one type of comment.

For example, if you run a social networking site, you might want to allow admins to leave private notes on users:

As I mentioned above, Drupal 8 allows you to add comments to more than just nodes. You can add comments to blocks, contact messages, content, taxonomy terms, users and even comments. Yes, you can add comments to comments.

However, without a contributed module from the Drupal community, there may be a limit to far you can take the example I’ve just shown. This is because Drupal 8’s comment types don’t have individual permissions. Anyone with permission to post on any type of comment will have access to post all types. Again, you can expect a contributed module or Drupal 8 update to fix this.

#3. Comments have fields

Not only are comments now fields in Drupal 8 (see change #2 above), but you can also add fields to comments:

#4. Recent comments is in Views

As with many things in Drupal 8, the Recent comments block has moved to Views. In Drupal 7, the Recent comments block couldn’t be edited.

In Drupal 8, Recent comments is available by default:

Instructor

  • Steve Burge

    Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Blog Rating
Subscribe
Notify of
15 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Chris Weber

The URL of this page seems to be mispelled:
[url=https://www.ostraining.com/blog/drupal/d8-comemnts]https://www.ostraining.com/…[/url]
did you mean [url=https://www.ostraining.com/blog/drupal/d8-comments]https://www.ostraining.com/…[/url]

Anonymous

Re comments having their own page (with these same bulk operations), that was a new feature in Drupal 4.7.

Aaron

Comments are not fields in Drupal 8; they are Entities, which are sets of fields. A good place to read up on the Entity concept: [url=https://www.drupal.org/node/1261744]https://www.drupal.org/node…[/url]

1kenthomas

Thank you ! This really should be clarified. A node is a node is an entity is an entity is fieldable.

Billie

[quote=Chris Weber]The URL of this page seems to be mispelled:
[url=https://www.ostraining.com/blog/drupal/d8-comemnts]https://www.ostraining.com/…[/url]
did you mean [url=https://www.ostraining.com/blog/drupal/d8-comments]https://www.ostraining.com/…[/url][/quote]

alex-smirnov

Thank you for the heads-up, Billie. We now corrected the typo.

Regards,
Alex

divaker

Thanks Alex

Artyom

“#3. Comments have fields
Not only are comments now fields in Drupal 8 (see change #2 above), but you can also add fields to comments”

This also possible in drupal 7

salman

Great tutorial,

But can you elaborate on how to create a private comment?
I want to have a registered user to be able to send a comment to a node author and mark it as private so that only the node author can view.

Thank you

Ajit Jain

OS Training is always good for self-learner and, and I am using this for the last 1 year.

Pan

Hi, 
What module using for this website?

Kane Jason

Great stuff! Thanks for sharing this. Drupal 9.1.0 – alpha 1 will be released on October 19th, 2020. Drupal is one of the very few CMSes that has stayed relevant for 15+ years. 

Kevin Johnson

Great Tutorial!

Thankyou!

as

testing comments feature in drupal 8 with ajax functionality

Louis

Great tutorial,

I want to have a registered user to be able to send a comment to a node author and mark it as private so that only the node author can view. 

Thank you

15
0
Would love your thoughts, please comment.x
()
x