Is the magento display mode conditional in the .xml directory?

Does anyone know how to add or customize the display mode in the .xml directory in magento?

if you are editing a category in the backend, on the "Display Settings" tab there is a drop-down menu for the "display mode", where you can only select the "static block". this actually turns your category page into a regular content page, the problem is that the page still inherits everything that you set for the regular category pages in the catalog.xml file, and I want to cancel all this if the display mode is "only static block. "

the closest identifier got this conditional value in /template/catalog/category/view.phtml

if($this->isContentMode()): echo $this->getCmsBlockHtml() 

and some conditional conditions of the product in the .xml directory

 <!-- Additional block dependant on product type --> PRODUCT_TYPE_simple PRODUCT_TYPE_configurable etc... 

Please, help!

+4
source share
1 answer

You can override the Mage_Catalog_CategoryController::viewAction() method before calling

 $this->generateLayoutXml()->generateLayoutBlocks(); 

You can add different layouts depending on the category settings. From these layouts you can remove blocks or add new ones.

0
source

Source: https://habr.com/ru/post/1342383/


All Articles