Conditional statements within inline text

This is a request for functionality, as I can apply conditions to elements, but not within text.

So, introduce the ability for Cornerstone to support conditional statements inline, like within a text element?

It would be great to have this within text, rather than having to create multiple elements (usually text).

An example:

{{dc:if:post:the_content!=null}}
<div class="content">
  {{dc:post:the_content}}
</div>
{{dc:else}}
<div class="content empty">No article found</div>
{{dc:/if}}

Or just:

{{dc:if:post:the_content!=null}}<div class="content">
  {{dc:post:the_content}}
</div>{{dc:/if}}

This has been requested before, but this thread is closed.

Hey @designextreme,

It looks like this hasn’t been added to our feature request list. I’ll add this now.

Thank you for your feedback.

1 Like

Checkout our Twig integration for conditional inline content. You might have to play around with condition example I’ll give below. Have a great day.

{% if post.the_content != ''%}
Content found
{% else %}
Content not found
{% endif %}
1 Like