Skip to content
Twig Field Finder
Theme

Template variables — view mode, logged in, front page

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
    {{ view_mode }}
  2. Snippet 2
    {% if logged_in %}
      …
    {% endif %}
  3. Snippet 3
    {% if is_front %}
      …
    {% endif %}

Gotcha

view_mode is set in entity templates; logged_in and is_front are default variables available in every template.