user2680289
user2680289

Reputation:

Magento : Find a layout handle for product category page?

I know : we can update a layout of a view in magento by using its layout handle for example "http://domain.com/shops/index.php/customer/account/index/" it has a layout handle like by using this in local.xml we can update layout of that particular view like removing the cart sidebar as follows

<layout version="0.1.0">
   <customer_account_index>
    <remove name="cart_sidebar"/>
  </customer_account_index>
</layout>

And what i want to know is, i created a menu items fall like men->Tshirts and it goes to the url like "http://domain.com/shops/index.php/men/t-shirts.html", how can i remove the cart sidebar from this page?

Upvotes: 0

Views: 4095

Answers (2)

Alana Storm
Alana Storm

Reputation: 166066

On category page the handles Magento fires (in order) are

  1. The full action name handler catalog_category_view

  2. A special catalog_category_layered handler

  3. A special CATEGORY_[ID] handler (where ID is a category id, like CATEGORY_8

That should give you what you're after.

If you're using Commerce Bug (the commercial Magento debugging extension I created and try not to over promote), you can grab this information from the Layout tab

enter image description here

Upvotes: 4

Marius
Marius

Reputation: 15206

You have the general layout for categories catalog_category_view, but Magento also loads a specific layout handle for a category <CATEGORY_{ID_HERE}> so you ca use for example <CATEGORY_5> You can also specify a custom layout code in the category edit page under the design tab. You can also set it's children to inherit this by editing them.

Upvotes: 5

Related Questions