Author - Paryank Kansara

I have extensive experience in web development of community based and enterprise level applications. My expertise includes sectors like: e-Commerce, Social Networking Portals, Content Management Systems, etc.

More Info » Follow me on Twitter »

Reader Comments (28)

  1. Creating Custom Layout Handles – Tutorials – Magebase | Magento Training Course

    […] how we can easily create our own custom layout handles to target specific conditions and scenarios. Link – Trackbacks source: Topsy – magento tutorial – Creating Custom Layout Handles […]

  2. Chris Jones
    September 2, 2011 at 6:57 pm /

    Thank you for this great post! Saved me hours of work 🙂

  3. yaroslav
    October 25, 2011 at 2:04 am /

    Great post!!! 🙂

  4. Jase
    November 2, 2011 at 8:35 pm /

    I implemented this a couple of weeks back and it worked a treat … but when xferring to the live server it fails to assign different templates based on the product attribute.

    I can confirm I tgz’d the whole folder, exported and imported the db, clear var/cache and update the db to point to the correct url. Is there anything I’m forgetting? When I hardcode a change in catalog.xml it is fine, it’s just ignoring the custom layout attributes in the same file.

    Any help anybody could provide would be greatly appreciated.


    1. Jase
      November 3, 2011 at 8:05 am /

      wow, turns it out on my dev box (running osx lion) freebsd is case insensitive so an incorrectly referenced path was still working fine, of course this broke on the live server – far out that took me AGES to figure out.

      Anyway happy now 🙂

  5. magento模板
    June 4, 2012 at 8:44 pm /

    Super tutorial about magento layouts! Thanks for your share! ! !

  6. Magento: Add Layout Handle for Product Attribute Sets ←

    […] is the version I am currently using. Another method for handling this is found at Magebase – Creating Custom Layout Handles. Their method uses an observer to add the handle before the layout is loaded, which is better than […]

  7. Amatya
    October 24, 2012 at 12:43 am /

    Thanks for such a nice tutorial.

  8. Pieter Pabst
    October 27, 2012 at 1:37 am /

    Thanks Paryank. Excellent tutorial.

  9. oliver montes
    December 21, 2012 at 3:28 am /

    Thx work great!

  10. Garziano
    March 13, 2013 at 10:04 pm /


    Thanks for the great post!

    I’m looking for a way to hyde a category top image when an attribute is selected.
    Basically I added to the manufacture attributes a custom cms block at the top… unique for each brand.
    The result is that when I click on the brand attribute the page refresh displaying all the product with the selected brand but at the top I got the category image + the specific attribute block.
    Is it possible in to hyde the category image when an attribute is selected with xml?

  11. WebFlakeStudio
    April 24, 2013 at 9:08 pm /

    Thank you for good post. I would like to recommend to use “frontend” area for this observer, and not “global”.

  12. Magento Out of Stock Message
    June 24, 2013 at 2:11 am /

    Prayank! Can you let me know where can I find the local.xml file ? I found some other code to create custom layout in another blog . But still confused. Can you assist me.

  13. Web Coder
    June 26, 2013 at 10:24 pm /

    Nice solution. Thanks for the tutorial. It really helped me a lot !

  14. Emiliano
    June 30, 2013 at 3:32 pm /

    Awesome! Excelente post, works like a charm. Thanks.

  15. Demystifying Magento’s Layout XML – Part 1

    […] Creating Custom Layout Handles […]

  16. Perez
    February 11, 2014 at 1:56 am /

    Hi Paryank Kansara, thank you for posting this wonderful solution.
    Have been using it to add tabs on product page based on attribute set.

    Recently updated to 1.8 and it stopped working. Anyone experiencing the same problem?

  17. Lights & Holsters Tactical Store
    February 20, 2014 at 6:51 am /

    This was an awesome post, extremely useful. Thanks for putting it up!

  18. Tahir Yasin
    April 15, 2014 at 3:49 am /

    Life saver article 🙂

  19. Jason Trinh
    May 31, 2014 at 3:08 am /

    So good! Why don’t you have like button?

  20. miguel
    September 17, 2014 at 9:01 am /

    se podria aplicar para tener un atributo como la pagina siguientes

    donde se ingresa un cantidad la cual se divide con el atributo fijo el resultado se redondea a la medida superior y se multiplica por el atributo fijo otra vez. soy novato en magento quiero hacer algo igual a esta pagina

  21. Magento Show Attributes on list/grid view based on Attribute Set - Technology

    […] I have followed the guide here to allow layout updates to be applied based on a products attribute set: […]

  22. Best tutorials for Magento | Ken Nguyen

    […] Creating Custom Layout Handles […]

  23. Muhammad Saeed
    Muhammad Saeed
    December 6, 2015 at 5:00 am /

    Thanks a lot for such a nice article.

    But what if the attribute-set name contains spaces ? or contain ampersand like (Home & Decor).

    does not work for me. Please help me to cop this out.

    Cheers! 🙂

  24. anonymenet
    April 13, 2016 at 1:08 am /

    Thanks a lot, very well written, true to the spirit of Magento !

  25. Rudy
    November 22, 2017 at 7:45 pm /

    Thank you so much!

  26. kathleen
    September 7, 2018 at 8:42 am /

    Great work and superb tutorial anyone can get help from this blog good work.


Add a Comment & Join the Discussion

Insert small snippets of code by using [code]{your_code_here}[/code]
For larger code blocks please use and paste your link.

You may also use the following HTML in your comment: <a href="" title=""> <abbr title="">
<acronym title=""> <blockquote cite=""> <cite> <em> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.