Page 1 of 1

PHP script if Content Block is Empty

Posted: Thu 9. Apr 2009, 16:52
by dennart
Sorry for my English.

Please help me. Will be work that sequence in template?

...

Code: Select all

<div>
{HEADER}

[PHP]
if(empty($content['CB']['HEADER'])

{echo ('<img src="i/himage_02.jpg" width="500" height="375" />');}

[/PHP]
<div>
...

Re: PHP script if Content Block is Empty

Posted: Thu 9. Apr 2009, 17:46
by flip-flop
Hi,

please have a look:

Code: Select all

[PHP]
echo empty($GLOBALS['content']['CB']['HEADER']) ? 'UNFILLED' : 'FILLED';
[/PHP]
Knut

Re: PHP script if Content Block is Empty

Posted: Thu 9. Apr 2009, 17:48
by dennart
Ok! Thanks, try it.

Re: PHP script if Content Block is Empty

Posted: Thu 9. Apr 2009, 17:51
by dennart
It cool. WORKING! Many thaks!