开发者

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

开发者 https://www.devze.com 2023-01-26 06:19 出处:网络
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 selec

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

精彩评论

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