magento display mode conditional in catalog.xml?
anyone know how to add or setup a display mode conditional in catalog.xml in magento?
if you edit a category in the backend, under the display settings tab there is a dropdown for "display mode" where you can select "static block only". this effectively turns your category page into a regular content page, problem is the page still inherits everything you set for normal category pages in catalog.xml, and i want to unset all that if the display mode is "static block only".
the closest ive gotten is this conditional in /template/catalog/category/view.phtml
if($this->isContentMode())开发者_运维技巧:
echo $this->getCmsBlockHtml()
and some product specific conditionals in catalog.xml
<!--
Additional block dependant on product type
-->
PRODUCT_TYPE_simple
PRODUCT_TYPE_configurable
etc...
please help!
You can override the Mage_Catalog_CategoryController::viewAction()
method and before calling
$this->generateLayoutXml()->generateLayoutBlocks();
You can add different layout handles depending on the category settings. From those layout handles you can remove blocks or add new ones.
精彩评论