I had it before, but now I can't find how to make a newsbox visible onlz if there is any content on respective "newsbox-page".
IOW
To show the newsbox onlz if there is something written on the page and hide it from template if the page is empty.
Conditional visible newsbox
Conditional visible newsbox
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Conditional visible newsbox
Simplest case:Tata wrote:how to make a newsbox visible onlz if there is any content on respective "newsbox-page".
Code: Select all
<?php if ($temp = newsbox('News')) echo $temp?>
Code: Select all
<?php if ($temp = newsbox('News')):?>
<div class="newsbox">
<?php echo $temp?>
</div>
<?php endif?>
Christoph M. Becker – Plugins for CMSimple_XH
Re: Conditional visible newsbox
Thanks, that's it. I have forgotten about the $temp.
But how would it sound if I want:
Showing some general NewsboxContent if the real NewsboxPage is empty and the NewsboxPage only if it has any content?
IOW
While there is no "NEWS!!!" message on the NewsboxPage a "WelcomePoster" would be shown in the newsbox. Another day I write some NEWS!!! and it will show up replacing the "WelcomePoster".
But how would it sound if I want:
Showing some general NewsboxContent if the real NewsboxPage is empty and the NewsboxPage only if it has any content?
IOW
While there is no "NEWS!!!" message on the NewsboxPage a "WelcomePoster" would be shown in the newsbox. Another day I write some NEWS!!! and it will show up replacing the "WelcomePoster".
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.