This forum has moved, please join us on github discussions. We will keep these old posts available for reference. Thank you!

Checking if my widget has content

Hi guys, I need to check with an if/else statement if my widget has content or not.
This is my code but not working:

  {% if emotionalScreen.hasContent %}
    <section class="content"><section/>
  {% endif %}

  {{
    apos.area(data.page, 'emotionalScreen', {
        widgets: {
          'emotionalScreen': {}
        }
      }
    )
  }}

How can I do?
Thanks

Hi JP, please post how-to questions to stackoverflow, tagged apostrophe-cms. This forum is for announcements and general discussion of Apostrophe’s future.

Thanks!