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 (20)

  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 :)

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

    Great post!!! :-)

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

    Hi,
    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.

    Cheers,
    Jase.

    Reply
    1. Jase
      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 :)

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

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

    Reply
  6. Magento: Add Layout Handle for Product Attribute Sets ← Smith-Web.net

    [...] 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.

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

    Thanks Paryank. Excellent tutorial.

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

    Thx work great!

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

    Hi,

    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?

    Reply
  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”.

    Reply
  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 http://blog.belvg.com/magento-tips-handles-in-magento.html . But still confused. Can you assist me.

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

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

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

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

    Reply
  15. Demystifying Magento’s Layout XML – Part 1

    [...] Creating Custom Layout Handles [...]

  16. Perez
    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?

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

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

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

    Life saver article :)

    Reply

Add a Comment & Join the Discussion

Insert small snippets of code by using [code]{your_code_here}[/code]
For larger code blocks please use http://pastebin.com 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>