Drupal 10: Using A Boolean Field In A Twig Template To Control Markup
13th April 2023
Assuming your boolean field is called field_page_check then the template should have this if statement in it.
{% if content.field_page_check is not empty and content.field_page_check['#items'].value == '1' %}
<p>This will be displayed if the check box is set to "true".</p>
{% endif %}
Add new comment