I have this piece of code in my cms:
<ul class="subsection_tabs" id="tab_group_one" style="clear:none;">
<?php if ($this->getChildHtml('description')==NULL) { echo '<div id="trollweb_1"></div>'; } else echo('
<li class="tab"><a href="javascript:void(0);" id="trollweb_1" onClick="trollweb_tabs(1)" class="active"><h4>' . $this->__('Product Description'). '</h4></a></li> '); ?>
The problem is it always outputs the ‘else’. Even though I haven’t filled in the description in the back end and it is blank.
How can I fix this?
Maybe getChildHtml() always returns a string (not NULL). And maybe the string in your test environment only contains whitespaces.
In that case trim() removes them and you can simply check the length of the string