Apostrophe CMS Main Site Forum Home

Checking if my widget has content


#1

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


#2

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!