Skip to content
Twig Field Finder
Theme

Comments — open / closed

Fill in your field name

Italic values are placeholders: replace them with your own machine names, or let the builder do it.

Reads the entity directly, before field formatters run.

  1. Snippet 1
    {{ node.field_name.status }}
  2. Snippet 2
    {% if node.field_name.status == 2 %}
      {# comments are open #}
    {% endif %}

Gotcha

2 is open, 1 closed (existing comments shown, no new ones), 0 hidden.