hide block if value empty

tevart

Avatar: tevart

2013-11-19 08:46

Hi all!

I would like to hide specific block in menus.tpl, if value is empty. I have this

<!-- IF:START MENUICON --><i aria-hidden="true" data-icon="&#x$aData[sMenuIcon];"></i><!-- IF:END MENUICON -->

If sMenuIcon has empty value, block MENUICON should be hidden.

tnx

» Quick.Cart v5.x

boboo

Avatar: boboo

2013-11-19 09:58

Exact for this reason the "IF" blocks have been created.
Somewhere in php code you create the variable aData[sMenuIcon]
Somewhere in the neighbourhood you should find:
$oTpl->setIf('MENUICON');
Ask before that for content in aData[sMenuIcon] and if not empty set this "setIf" on that.

boboo :-)

tevart

Avatar: tevart

2013-11-19 10:19

Tnx boboo...here's what i tried and didn't work

in actions/pages.php i added

if(!empty($aData['sMenuIcon'])) $oTpl->setIf( 'MENUICON' );

Didn't work...icon is not showing, even it has value.

btw. can you mail me at tevagoa@gmail.com...for something completly different.

Back to top
about us | contact