Questions tagged [comments]

Use it for questions about the comment entity.

Filter by
Sorted by
Tagged with
-1
votes
0answers
11 views

Media Comments on Activity Stream when using Open Social

I have added the ability for users to upload Media to my OS install. I have a Media Type of Photo and have configured media to create a Message that displays in the activity stream. For some reason no ...
0
votes
1answer
17 views

How to hide “Log in or register to post comments” when I've already disabled displaying comments?

I already disabled comments. How can I remove the "Log in or register to post comments" text at the bottom of articles or other content types?
1
vote
1answer
36 views

twig template suggestion for comment reply form

there is no template suggestion for a comment reply form in Drupal 8, how can i create one? i am not talking about the reply form displayed in the node for which Drupal suggest a template : field--...
1
vote
1answer
69 views

Allow comments only for the author of the node

I'm using Drupal 8 for a personal project and I'd like to allow only the node author to post comments. Can you please help? I'm stuck.
1
vote
1answer
22 views

Display comment form without the comment thread

What are some ways of rendering a comment form without also displaying the comments? What about creating a block contains the form? If that's possible, what are some links to documentation touching ...
0
votes
0answers
27 views

Is there an easy way to programmatically add a comment field to a content type? [duplicate]

I currently have the following code in a D8 module: $sql = 'CREATE TABLE `comment__field_follow_up_date` (' . "`bundle` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The field ...
0
votes
0answers
9 views

Removing comment from front page view

I recently added the Disqus module to my website. I have it up and running however I've noticed that when I go to my front page the most recent post always has a comment section at the bottom of it. ...
0
votes
1answer
30 views

Show Comment Form on its own Page or Popup

I am trying to figgure out how to show the comment form on its own page. So far I have been able to show it on a seperate page. All I had to do was to go to field comment setting and uncheck "Show ...
0
votes
0answers
7 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 ...
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
19 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
24 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
58 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
108 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
18 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
69 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? ...
1
vote
1answer
53 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
215 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
27 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
31 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') ...
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
3k 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
225 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
1answer
17 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
25 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
76 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
28 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
34 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
216 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
1k 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
71 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
85 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
57 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
382 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
64 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
165 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
125 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
83 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
555 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
47 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 ...
0
votes
2answers
362 views

Author image in comments twig

I succesfully get user name, surname and date to render in comment.html.twig like this function MYTHEMENAME_preprocess_comment(&$variables) { $comment = $variables['comment']; $variables['...

1
2 3 4 5
17