Default theme implementation for a comments container.
Available variables:
The following variables are provided for contextual information.
{% if display_mode is constant('COMMENT_MODE_THREADED') %}
<h3>{{ 'These comments are displayed in a threaded list.'|t }}</h3>
{% endif %}
template_preprocess_comment_wrapper()
- {#
- /**
- * @file
- * 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:
- * @code
- * {% if display_mode is constant('COMMENT_MODE_THREADED') %}
- * <h3>{{ 'These comments are displayed in a threaded list.'|t }}</h3>
- * {% endif %}
- * @endcode
- * - COMMENT_MODE_FLAT
- * - COMMENT_MODE_THREADED
- *
- * @see template_preprocess()
- * @see template_preprocess_comment_wrapper()
- *
- * @ingroup themeable
- */
- #}
- <section{{ attributes }}>
- {% if comments and node.type != 'forum' %}
- {{ title_prefix }}
- <h2 class="title">{{ 'Comments'|t }}</h2>
- {{ title_suffix }}
- {% endif %}
-
- {{ comments }}
-
- {% if form %}
- <h2 class="title comment-form">{{ 'Add new comment'|t }}</h2>
- {{ form }}
- {% endif %}
-
- </section>