Magento Tips: Handles in Magento

Magento Tips: Handles in Magento

When customizing a Mаgentо shop it is often needed to apply different page design for each type of product. For these purposes are used handles of these types of products in the catalog.xml file:

The necessary handle may not exist, but we can always create our own.

For example, let’s add a handle to a product’s Attribute Set, so that we would be able to apply changes to a product, depending on which Attribute Set it relates to.

To do this we will create a module and an observer and will register to the event controller_action_layout_load_before. In the observer we will create a method, which will verify if the module is enabled, and will add our handles.

Attribute Set Handle

Download Attribute Set Handle from GitHub



3 comments

  1. Snowcore,

    I do it in order to locate our new handle right after a product type handle. I.e., after the product type handle and before a handle for a particular product (PRODUCT_ID_).

  2. Aleksander! This is embarrassing tips to create custom theme for each page. I wonder is that include this in my files? I take a google search and find in blog says I would need to add this in config.xml. Can you confirm should I add this in Local xml or to where?

    Cathy

Post a new comment

top