Skip to content
Twig Field Finder
Theme

Comment — author, date, body (comment.html.twig)

Open in builder

This is a property of the entity itself, so there’s no field name to fill in.

Reads the entity directly, before field formatters run.

  1. Snippet 1
    {{ comment.getAuthorName() }}
  2. Snippet 2
    {{ comment.created.value|format_date('medium') }}

Reads the content render array, after field formatters run.

  1. Snippet 1
    {{ author }}
  2. Snippet 2
    {{ created }}
  3. Snippet 3
    {{ content.comment_body }}

Gotcha

In comment.html.twig the entity is comment. author, created and permalink are ready-made template variables.