开发者

Magento - Show / hide CMS block when display mode 'Static Block and Products' selected in category

On my top level categories, I'd like to use both static blocks and products along with layered navigation. The way I want to use it is that when none of the layered navigation options have been selected, a static block only displays (toys.phtml), whereas开发者_JAVA百科 if any of the options are selected, the static block is hidden and only the products display (toys.phtml?brand=1).

Does anyone have any suggestions for this? I'm pretty sure I can hide the products (check URL string for $_GET variables), but not sure how I can hide the static block.

Thanks in advance.


You should modify or override the Mage_Catalog_CategoryController (viewAction) and add right before the $this->renderLayout(); instruction, add the following:

if($this->getRequest()->getParam('brand'))
    $this->getLayout()->unsetBlock('yourstaticblockname');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜