Default theme implementation for a comments container.
Available variables:
- comments: List of comments rendered through comment.html.twig.
- form: The 'Add new comment' form.
- content: The content-related elements for the comment display. Use
'content' to print them all, or print a subset such as
'content.comment_form'.
- attributes: Remaining HTML attributes for the containing element.
It includes the 'class' information, which includes:
- comment-wrapper: The current template type, i.e., "theming hook".
- title_prefix: Additional output populated by modules, intended to be
displayed in front of the main title tag that appears in the template.
- title_suffix: Additional title output populated by modules, intended to
be displayed after the main title tag that appears in the template.
The following variables are provided for contextual information.
- node: The node entity to which the comments belong.
- display_mode: The display mode for the comment listing, flat or threaded.
The constants below show the possible values and should be used for
comparison, as in the following example:
{% if display_mode is constant('COMMENT_MODE_THREADED') %}
<h3>{{ 'These comments are displayed in a threaded list.'|t }}</h3>
{% endif %}
See also
template_preprocess()
template_preprocess_comment_wrapper()
File
drupal/core/modules/comment/templates/comment-wrapper.html.twig
Related topics