Last active
February 7, 2023 00:32
-
-
Save rikki-iki/23e382ea794fbe7c75fccd312b45baa8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Check if a field has a value before printing it #} | |
{% if node.field_name.isEmpty == false %} | |
<p>{{ content.field_name }} </p> | |
{% endif %} | |
{# Check if block is empty #} | |
{% if block('block_name')|trim is not empty %} | |
<div>{% block block_name %}{% endblock %}</div> | |
{% endif %} | |
{# Check if a region has any output before #} | |
{% set region_name %}{% apply spaceless %} | |
{{ content.region_name }} | |
{% endapply %}{% endset %} | |
{% if region_name or is_layout_builder %} | |
<div {{ region_attributes.region_name }}>{{ region_name }}</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment