1

I am attempting to replace the block that shows the image in the product view. I'm doing so programmatically with layout.xml. I've got it to work for all the products but I want to do it for only one category. My layout.xml is below; it is called from my config.xml in my module.

<?xml version="1.0"?>
<layout>

        <catalog_product_view>
           <!--here is where I had <CATEGORY_35> but it doesn't work-->
                    <reference name="head">
                                <action method="addJs"><script>chrysalis_monomer/chrysalis.js</script></action>
                    </reference>

                    <reference name="product.info.media">
                        <action method="setTemplate">
                            <template>catalog/product/view/chrysalis.phtml</template>
                        </action>
                    </reference>

           <!--/CATEGORY_35-->
        </catalog_product_view>

</layout>

where or how should I use a category handle to narrow this down to only products in a specific category? what about for only specific products? can I use a handle?

Chris Chalmers
  • 574
  • 4
  • 13

2 Answers2

1

Category handles are not available on product view page. You can use product handle <PRODUCT_id> instead to target specific products. Also you can't put one handle inside another.

<?xml version="1.0"?>
<layout>
  <PRODUCT_123>
        <reference name="head">
              <action method="addJs"><script>chrysalis_monomer/chrysalis.js</script></action>
        </reference>

        ...

  </PRODUCT_123>        
</layout>
subroutines
  • 1,458
  • 1
  • 12
  • 16
0

Chris Chalmers, layout handler is Workington when your in categorises page and this layout handler is auto generated basic of category and so it is not working

Amit Bera
  • 7,581
  • 7
  • 31
  • 57