Hiding breadcrumb using attribute

Permalink
Hi,

I'm trying to use an attribute to hide the breadcrumb on selected pages.

I've currently got the following code which isn't working.

<?php
if ($c->getCollectionAttributeValue('hide_breadcrumb') !== '1'):
$a = new GlobalArea('breadcrumb');
$a->display($c);
endif;
?>

Any pointers massively appreciate.

laweffect
 
hutman replied on at Permalink Best Answer Reply
hutman
Assuming your attribute is a boolean (checkbox) attribute you should be able to just do this

<?php
if (!$c->getAttribute('hide_breadcrumb')):
$a = new GlobalArea('breadcrumb');
$a->display($c);
endif;
?>
laweffect replied on at Permalink Reply
laweffect
Thank you! It works like a dream. I've just spent the last two hours trying to figure this out.
jelsieni replied on at Permalink Reply
Pretty cool and I love this.
http://myloweslife.onl/