Im using code like this:
{% if apos.utils.isEmpty(apos.areas.richText(data.page.heroHeadingMobile, { delimiter: ',' })) %}
test content {{ apos.areas.richText(data.page.heroHeading, { delimiter: ',' }) }}
{% else %}
{{ apos.areas.richText(data.page.heroHeadingMobile, { delimiter: ',' }) }}
{% endif %}
But I have also tried like this:
{% if apos.utils.isEmpty(apos.areas.richText(data.page.heroHeadingMobile, { delimiter: ',' })) %}
test content {{ apos.areas.richText(data.page.heroHeading, { delimiter: ',' }) }}
{% else %}
{{ apos.areas.richText(data.page.heroHeadingMobile, { delimiter: ',' }) }}
{% endif %}
But I never seem to be able to get the else condition to fire:
I am using this inside another condition, not sure if that ok, here is an example of my complete code:
<h1 class="hidden-sm hidden-md hidden-lg">
{% if data.page._edit %}
{{ apos.singleton(data.page, 'heroHeadingMobile', 'apostrophe-rich-text', {
toolbar: ['Styles','Bold', 'Italic', 'Subscript', 'Superscript', 'Link', 'Unlink'],
styles: [
{ name: 'Strong Font', element: 'span', attributes: { 'class': 'headline2'} }
]
}) }}
{% else %}
{% if apos.utils.isEmpty(apos.areas.richText(data.page.heroHeadingMobile, { delimiter: ',' })) %}
test content {{ apos.areas.richText(data.page.heroHeading, { delimiter: ',' }) }}
{% else %}
{{ apos.areas.richText(data.page.heroHeadingMobile, { delimiter: ',' }) }}
{% endif %}
{% endif %}
</h1>