1

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.article.comment but nothing changed. Any suggestions please?

1 Answer 1

2

You can override field--comment.html.twig template.

https://api.drupal.org/api/drupal/core%21modules%21comment%21templates%21field--comment.html.twig/8.8.x

<section{{ attributes }}>
  {% if comments and not label_hidden %}
    {{ title_prefix }}
    <h2{{ title_attributes }}>{{ label }}</h2>
    {{ title_suffix }}
  {% endif %}

  {{ comments }}

  {% if comment_form %}
    <h2{{ content_attributes }}>{{ 'Add new comment'|t }}</h2>
    // you can add your markup here
    {{ comment_form }}
  {% endif %}

</section>

clear the cache after add new template file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.