Check if field is empty
Fill in your field nameItalic values are placeholders: replace them with your own machine names, or let the builder do it.
Raw entity
Open in builder (Raw entity)Reads the entity directly, before field formatters run.
- Twig
{% if not node.field_name. isEmpty( ) %} {{ content.field_name }} {% endif %}
Render array
Open in builder (Render array)Reads the content render array, after field formatters run.
- Twig
{% set content_render = content.field_name| render %} {% if content_render| trim %} {{ content_render }} {% endif %}
Gotcha
Use the render-and-trim pattern when isEmpty() is not reliable (e.g. field present but formatter outputs nothing). It avoids rendering the field twice.