switch visibility of content block
Posted: Fri Jun 11, 2021 1:13 pm
Hi!
Depending on the status of my content, I want to hide the <article> block. So I added a simple Smarty if-statement:
Unfortunately it does not work. The <article> block is always hidden, eventhough my content has text:
I also tried it like this:
Same result. Can anybody shed some light on how I can switch the visibility of my <article> block depending on whether {content} has some text in it?
Thanks!
Christian
Depending on the status of my content, I want to hide the <article> block. So I added a simple Smarty if-statement:
Code: Select all
<article {if empty($content) }style="display: none;"{/if}>
{content}
</article>
Code: Select all
<article style="display: none;">
Lorem ipsum ...
</article>
Code: Select all
<article {if !isset($content) }style="display: none;"{/if}>
{content}
</article>
Thanks!
Christian