Questions tagged [comments]

Use it for questions about the comment entity.

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Ajax submit comments by pressing enter

I am using the Ajax comments module and display suite. https://www.drupal.org/project/ajax_comments When pressing submit button the comment form gets submitted via ajax as it is supposed to. When I ...
1
vote
0answers
39 views

How do I create a message when a node is flagged?

I created a custom module based on the Drupal 8 Message mold. This module creates a message when a comment is created. It's perfect. Now I want the module to create a message when a node is flagged. ...
0
votes
1answer
33 views

How to display an alternative text if the comments are closed for the node?

in my node type template, how do I display alternate text if comments are closed for the node ? {% if content.comment %} <div class="card mb-5 p-3 shadow"> {{ content.comment }} ...
1
vote
0answers
18 views

How to add custom query to comment entity

I have comment thread field attached into a node. I would like to have a search function by keyword. I used hook_query_TAG_alter() to add database condition according to my needs. Here's my current ...
1
vote
1answer
14 views

Add text message under “Add new comment” title

I would like to add a disclaimer message under "Add new comment" title and above the form in drupal 8 site. I changed the help text on this path /admin/structure/types/manage/article/fields/node....
3
votes
1answer
52 views

Where do I find the comment IP address?

I am searching for comments ip address in D8 and I can't find where they are located in database. In D7 it was easy to find. Is there a chance that D8 is not storing the commenters ip address? If it ...
-1
votes
1answer
27 views

Commenting or replying a specific node without the possibility of commenting others?

I built a website sort of like an online directory for restaurants in my home town, and I am letting the users to leave their reviews about a specific restaurant, and what I need is to give access to ...
0
votes
1answer
68 views

How to count the number of comment and flag in a node?

I want to display on my node the number of comment and flag. What should I add to my TWIG to get this? How to count the number of comment and flag in a node? Here is an example :
0
votes
1answer
16 views

Add a Radio-button with other option in comment type

I have the following requirement in Drupal 8: I have to create a comment type with options. In options there will be a Other option on whose click a text field will be opened. something like below ...
0
votes
1answer
40 views

How can I prevent “Log in to post comments” from displaying for anonymous users?

How do I remove the "Log in to post comments" from the bottom of my content in Drupal 8 while keeping old comments visible to all and allowing existing registered users to still comment? Basically, I ...
1
vote
1answer
51 views

How can I display the time passed since a comment was created instead of the creation date?

how to personalize my comments ? I want to display since when the comment was created instead of the date. I want to display the comment ID with the link "permalink". Can you help me ? Thank you ...
0
votes
1answer
20 views

Get Relationship for the Author of the Latest Comment

In a Node view, I am trying to group the latest comments by the author's field_last_name, but I am having difficulty adding this field. I tried using the the "Last comment" and "Last comment author" ...
1
vote
2answers
102 views

Twig template print all comments but not the comment form

For context: in my template file node--some-node.html.twig i have a grid of items which have a custom comment form on them. The form creates a comment through an API. The form passes the ID of the ...
1
vote
2answers
43 views

Rules scheduler reacting on last comment?

I have a content type with comments activated and would like to have a rule that triggers a component when there is no new comments posted after a week. The component works as designed with rules ...
1
vote
0answers
25 views

How to create a query nodes, that queries content with more than one comment?

Consider this example: $query = \Drupal::entityTypeManager()->getStorage('node')->getQuery(); $nids = $query->condition('type', 'question') ->condition('status', 1) ->...
0
votes
1answer
26 views

How can I load comment IDs using the comment type?

I know how to load comment ids for a particular node by following code $entity_manager = \Drupal::entityTypeManager(); $cids = $entity_manager ->getStorage('comment') ->getQuery('AND') ...
0
votes
0answers
46 views

How to display the parent node or product of a comment?

I installed the Message module on my site. I created a custom module that created a message when a comment is created. https://imgur.com/a/4OLhGlL How to display the parent node or product of a ...
1
vote
2answers
43 views

How do I let non-admin user approve comments?

I'm looking for a way to allow a non-admin user to approve comments. I thought a Flag/Rules combination might be a solution but I can't figure it out. I added a content-moderator role, then I ...
3
votes
1answer
2k views

Mismatched entity and/or field definitions for comment field

I have been receiving this message ENTITY/FIELD DEFINITIONS Mismatched entity and/or field definitions The following changes were detected in the entity type and field definitions. Comment The ...
0
votes
0answers
40 views

How do I make comment URLs include the node URL on which they are displayed?

Default URL for comments is comment/1#comment-1. I would like it to be [node URL]#comment-1 where [node URL] is the URL of the node on which the comment is displayed. I have tried to use the pathauto ...
0
votes
0answers
156 views

How to display number of comments of a node as part of a “content” view with fields

I created a content view in D8, which shows me fields of a content type. Basically it works. Now I would like to have the total number of comments per listed node displayed as a view field ...
0
votes
0answers
12 views

How to add custom action to OPERATION dropdown in comment page?

In /admin/content/comment page, under "OPERATIONS", there is a dropdown menu with edit and delete actions for each comment, how can I add a custom action, such as Email in the dropdown menu? Any help ...
0
votes
1answer
16 views

override view Use administration toolbar

i have a view that using administration toolbar. Problemis theme suggestion is not showing the template names that should override the template. i guess because its using the administration toolbar .. ...
0
votes
0answers
20 views

Comment body not displaying

I have an interesting problem where the comment body does not appear with the comment. The field wrapping is in the HTML but the content portion is always blank. This problem occurs regardless of the ...
0
votes
1answer
51 views

comments module with infinite scroll

I've added a comment field to my content type. Now I'd like to add infinite scroll to the comments messages, so it shows by default some number of comments and when I click on the load more button, it ...
0
votes
0answers
36 views

Comment API Endpoint for restful module drupal 7 not working

I am trying to put comment to a node using POST method to the endpoint api/v1.1/comments Here is the API file: <?php /** * @file * Contains \Drupal\restful_example\Plugin\resource\comment\...
0
votes
0answers
19 views

Understanding the threading functionality of comments

I'm working on building my own module, and it uses functionality similar to comments, so I'm trying to use it as a reference. My module uses replies, which are 'threaded' to a parent reply. There ...
0
votes
0answers
36 views

How to integrate two modules

I'm currently working on modifying https://www.drupal.org/project/react_comments module to support https://www.drupal.org/project/comment_notify. I need advice. Comment Notify module marks comments ...
0
votes
0answers
27 views

change Comments per page

I need to change the comments per page value, I set it 50 from the field setting but in some pages, I need showing only 10 comments, not 50. I tried to use this method setSettings([ 'per_page' =...
0
votes
0answers
14 views

How to move comment submit button inside fieldset

I created a new group for a content type under Comments Fields (admin/structure/types/manage/page/comment/fields), and set the type Fieldset. Is there a way to move the comment Submit Button inside ...
0
votes
0answers
10 views

How do I create a link for unapproved comments of an article?

In addition to the default links (Delete, Edit, Reply, Approve), how do I create a link such as "Email" for unapproved comments of an article(ex: /comment/12#commnet-12)?
0
votes
0answers
29 views

How do I name the comment.tpl.php file to use it in my own theme?

I have copied comment.tpl.php from mytheme/modules/comment into root/sites/all/themes/mytheme/templates. What should I name it to override the core template? The form ID is places-to-go-entry. I ...
0
votes
1answer
175 views

How do I fix the errors I get after removing the comment field from a content type?

After I removed the comment field from the user interface, and uninstalled the Comments module, I can't open any Article node. In the Drupal log, I find this message. InvalidArgumentException: ...
1
vote
2answers
868 views

How to render author custom fields info on comment and node twig template?

I am trying to render the author Full Name and other authors customs fields information in comment.html.twig and node.html.twig. But not any of the fields that I made for users such as "First Name", "...
1
vote
2answers
66 views

How can I leave Subject as blank when fill nothing in the subject field of a comment?

When we fill nothing in the subject field of comment, drupal will use the comment body as the value of subject. See the code in CommentForm::buildEntity // Validate the comment's subject. If not ...
0
votes
0answers
41 views

Displaying same username for all users with a specific role as comment author

I need to display the same username for users of a specific role as comment author. I have a Role 'Board Moderator'. When users with this role are commenting, a uniform name 'OneUserNameForAll' ...
1
vote
1answer
47 views

How to create a view to count comments per user?

I am trying to create a view with a table that shows all the users and the total number of comments that user posted in descending order. I am not sure what I am doing wrong but I spent hours on this ...
0
votes
0answers
69 views

What's the correct way to create a custom formatter for a comment?

I'd like to create a custom formatter for the field Comments. My goal is to display a custom comments section beside CKEditor (URL /node/xx/edit). Following this article, I created my custom module: ...
0
votes
0answers
56 views

Comment file upload not working

Looks like we have two versions of jQuery loading. Hence the "(...).once is not a function" errors in the console. jquery.once is definitely loaded but only for the first version of jQuery. Nightmare....
-2
votes
1answer
331 views

How to add reply link under every comment?

I using standart Drupal 8 module for comments. Can I add reply link under comments or I have to install another module? I'm log in as administrator, but i dont see edit/delete/reple link Help please!...
-1
votes
1answer
55 views

Can not use a comment display mode

In my comment type, I created a "teaser" view. When I enable the debug mode in the "service.yml" file, the display modes of the comments do not appear in the suggestions. Why ? How to use a ...
1
vote
2answers
1k views

Validation with hook_form_alter()

In Drupal 8, for the Comment entity, I want to validate an integer field (stored as field_nieuwe_waarde_value). In each comment posted for a node, it needs to be greater than the value for the ...
0
votes
1answer
146 views

Why are the edit/delete/reply links missing in the Comment module?

I'm using 8.6.0 core's Comment module. I can add comments, but I can't edit or delete them. I also can't reply to anyone else's. Permissions have been set that all authenticated roles can edit. I'm ...
0
votes
1answer
40 views

Anonymous users skip comment approval but they shouldn't

In my drupal 8.6.1 news blog anonymous users can skip comment approval althouth permissions are set to not skip. I rebuilt the permissions but nothing changed. Also in comments page I see that some ...
0
votes
2answers
106 views

Custom submit handler stops working when checking route

I'm trying to setup a custom submit handler, so I can change the redirect URL after submitting comments. Edit: I just want to send users back to the page they were viewing to begin with, but it's a ...
2
votes
1answer
80 views

How to implement per user caching when restricting display of comments by author

I have threaded comments on a site where there are two roles, reviewers and administrators. Comments are shown in a view block added to the node (in this case a webform). The view format is set to '...
3
votes
1answer
503 views

Why doesn't the token for the node title work?

In Drupal 8, I activated the Message module and the Message Example sub-module. These are the fields I added to the template to create a message when a new comment is created. This is the ...
1
vote
3answers
1k views

How can I get all comments for a node?

I have have a content type (Stuff) with an entity reference field (comments) for comments (their type is Stuff comments) with a single field (comment_body). Inside a controller, I loaded a node by ...
0
votes
0answers
10 views

Comments on Arabic version of page are not shown under content after admin approval

I am working with drupal8 website. Here am using both arabic and english translation. Authenticated users have the permission to post and view the comments. When an auhenticated user posted a comment ...
0
votes
1answer
45 views

Why do users with permission to post commenst get “You do not have permission to post a comment”?

I have some users with roles administrator, authenticated etc. All such user roles have permission to post a comment. But when posting a comment it is showing error "You do not have permission to ...

1
2 3 4 5
17