Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Apply a layout update on all products in one category
 
fenixf
Member
 
Total Posts:  35
Joined:  2008-04-08
 

I know I can use layout update on a certain product using the Custom Layout Update field.
But what if I wanted to have all the product in a certain category use this Custom Layout?

So i thought I put

<reference name="content">
            <
block type="catalog/product_view" name="product.info" template="catalog/product/view_2.phtml">
</
reference>
in the Custom Layout Update field of that category.

But it’s not working. Putting the code in the Custom Layout Update field of the product works well.

So what’s happening here?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hyperbuzzy
Jr. Member
 
Total Posts:  7
Joined:  2008-04-15
 

I have the same issue. Is there a solution anyone is aware of?

I’d really rather not copy the same XML into the Custom Layout Update field for every product in a category.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
phlux0r
Member
 
Avatar
Total Posts:  73
Joined:  2008-03-09
Auckland, New Zealand
 

The way I think the category layout updates work is that it only updates the layout for the selected category, not the children or products.

You will probably need to create another custom template under your template structure and set the category to use that template and apply it to all products in the category and subcategories. In your custom template, just have the catalog.xml layout with your updated layout. Then you select the new template for the desired category in the admin. This will then apply your new layout to just that category and all children (if you set the dropdown accordingly).

So you will have the following template structure:

app/
  design/
    frontend/
      my-main-theme/
        layout/
          …
        locale/
          …
        template/
          …
      my-special-category/
        layout/
          catalog.xml (or whatever layout file contains your custom layout)

You can also do this with the skin directory if you need to use special styles, images etc. but the design bit should be enough just for the custom layout.

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fenixf
Member
 
Total Posts:  35
Joined:  2008-04-08
 

just answered to other thread:
http://www.magentocommerce.com/boards/viewthread/2142/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top