Articles in this series

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

  1. Chris
    October 12, 2010 at 10:38 pm /

    Great! Really looking forward to the rest in the set!

  2. Matthew Ellis
    October 27, 2010 at 11:36 pm /

    This is awesome! Thanks so much. The official docs for Magento are really, really poor. This one page alone is worth more that a whole day on the Magento forums! Hope part 2 comes soon.

    1. Joe Fletcher
      November 3, 2010 at 9:03 am /

      I’ll second that! This is seriously the “missing manual” on how to learn Magento’s XML system. I’ve been doing Magento sites for a few years now, but just now getting the hang of the XML for layout as opposed to hardcoding in the phtml template files.

    2. John
      July 21, 2011 at 9:55 am /

      I third that. Bravo Paryank!

      1. Robert Popovic
        July 22, 2011 at 9:21 am /

        Yes, understanding the layout XML is very important and gives powerful tools and techniques for customizing Magento.

        We’re glad you guys find the material here useful.

        1. Alex
          July 22, 2011 at 4:17 pm /

          Awesome website you guys have here. Keep it up! Thanks a bunch for sharing your knowledge.

  3. Matt
    November 3, 2010 at 9:38 am /

    Really useful, thanks! Would be great to see some advice on working with local.xml to control layouts in the future.

    1. Robert
      November 3, 2010 at 9:49 am /


      In our second installment that’s already under way, we will talk about local.xml. In fact, it’s such an important “trick” that we will post a Quick Tip just about local.xml very soon.

  4. Matt
    November 3, 2010 at 10:53 am /

    Good to know! Some things I’ve been struggling with local.xml were/are: firstly simply just finding the reference names for the parts of the layout I want to alter! Then finding the handle name for the specific parts I want to work with eg ‘tags_popular’.

    I’ve been looking for a definitive reference for action names and their uses. Loads of tutorials cover just removing stuf but not seemingly simple stuff like moving and reordering the page components.

    I could go on and on! I look forward to future posts.. really useful resource, thanks again.

  5. osdave
    November 11, 2010 at 2:23 am /

    this is just awesome! thank you so much for this.

  6. katzkie
    November 22, 2010 at 4:29 pm /

    hey, thanks for the info. this really helps me a lot. I can’t wait for the part 2. I bookmarked your site hoping I could get some solutions from you. Looking forward for more tutorials.

  7. Kristof
    November 26, 2010 at 9:33 am /

    @Matt you should check out CommerceBug by Alan Storm. It gives a whole lot of useful information about the current page including the complete xml which Magento loaded. It’s worth the money considering how much time you could spent searching for this information.

  8. Matt
    November 26, 2010 at 11:55 pm /

    @Kristof – that looks like just what I need! Really useful, thanks for the info.

  9. David
    March 16, 2011 at 2:06 am /

    Thanks guys, very useful, im slowly building up my knowledge of Magento.

  10. Banners Anywhere With Magento Widget Instances – Tutorials – Magebase

    […] for selection. You may be using a theme developed for Magento 1.3 or lower. You can reference our Layout XML article for hints on how to add the block labels to your […]

  11. Ally
    May 26, 2011 at 10:33 pm /

    Superb article – just wish I had found it about 6 months ago. Really helps clear up a lot of misunderstanding in regards to xml layout.

  12. Craig
    June 2, 2011 at 2:21 am /

    What a great article after reading some guides on the Magento website came across this and things are becoming alot clearer especially what the layout elements and block types mean. Thanks

  13. 5 useful tricks for your Magento local.xml – Tutorials – Magebase

    […] have covered a lot about Magento’s layout XML in our past 2 articles [1] [2]. We saw that Magento will read the layout XML files in a specific order and that the local.xml […]

  14. Creating Custom Layout Handles – Tutorials – Magebase

    […] discussed in previous articles about Magento’s Layout XML, Layout Handles in Magento’s layout XML are XML nodes which contain the definition of updates […]

  15. Luglio7
    September 20, 2011 at 4:50 am /

    Waaa, just what i’m looking for ! thank you very much.

  16. Gustavo
    October 10, 2011 at 11:08 am /

    Man, this is amazing.

  17. 5 Useful Tricks For Your Magento local.xml | 奇才哥的外贸B2C SEO,SEM点滴

    […] have covered a lot about Magento’s layout XML in our past 2 articles [1] [2]. We saw that Magento will read the layout XML files in a specific order and that […]

  18. Frank Kemmer
    January 12, 2012 at 2:26 pm /

    We want to be able to re-order the attributes displayed when we compare products. Currently the attributes are displayed in the order they were created. For example when comparing attributes they display as::

    Item Number

    If we want to add a new attribute such as “LUMENS”, it will display at the bottom of the list, but we would like to have it display between Brightness and Weight.

    We cannot find a way to reorder the display to order the attributes as we would like them to display. Do you have a suggestion or would you be able to assist us with this project?

    1. Dani
      January 18, 2012 at 9:17 am /

      Frank in admin section in attribute edit page you have position for every attribute at the layer nav …this can help you order your attributes 🙂

  19. mobinaute
    March 22, 2012 at 10:33 pm /

    thank you so much for this very rich article that made things about magento’s layout clear to me.
    I just have a question about how far can we take advantage of, can we make it responsive using one of those responsive web desing’s frameworks?
    thanks a lot 🙂

    1. Robert Popovic
      March 24, 2012 at 12:24 pm /

      Magento’s layout xml is for controlling the content that appears on the pages in the various areas of the site.

      This doesn’t affect the implementation of the responsive design frameworks since those mainly affect the skin CSS using @media queries which are independent from the layout.

      Look at is this way:
      The layout xml governs the generation of the HTML and content on the pages. Your skin CSS and JS govern what happens with the HTML and content on the browser front-end which is where the responsive design is active.

    2. mobinaute
      March 25, 2012 at 12:43 pm /

      Thank you so much Robert for replying, Yes I see clearly now, the changes could affect the templates too, I ve noticed that there’s no header or nav tag of HTML5 in there, which using media queries does require. I ve spent 2 days just trying to make the categories responsive, but it seems to be very hard work!! my question if you allow me is: could magento existing themes turn reponsive? or they have to be created that way from zero? in the two cases it seems to me that it would be the hardest choice for a cross media strategy, am I right?

  20. david
    March 25, 2012 at 2:16 am /

    you say in the article:

    ifconfig can only be used within an action element

    And I was thinking the same, but I have just seen in the rss.xml this attribute applied to a block. In the default handle, line 36:
    {code} {/code}
    do you know something about thi particular use of ifconfig

  21. david
    March 25, 2012 at 3:13 am /

    sorry for the double posting, here is the code I was refering to:

            <block type="rss/list" name="head_rss" ifconfig="rss/config/active" />
  22. john
    April 12, 2012 at 4:25 am /

    Thanks a lot for writing this post!

  23. Understanding the Grid Serializer Block – Tutorials – Magebase

    […] Here, the root block is core/text_list type. So all children blocks are automatically rendered in sequence. See Demystifying Magento’s Layout XML Part 1. […]

  24. Magento Tips | Peter Zhou's Blog
    June 13, 2012 at 4:15 am /

    […] Magento’s Layout XML VN:F [1.9.7_1111] please wait… Rating: 10.0/10 (2 votes cast) […]

  25. Ben Marks
    August 15, 2012 at 7:31 am /

    Great writeup. One note: the layout update handles derived from the action’s full action name are based on the router configuration node name, not the frontname value which is incorrectly identified above as



  26. Ruiwant Magento
    August 30, 2012 at 2:12 am /

    Thank you very much. A wonderfull layout tutorial of magento!!!

  27. Peter
    October 24, 2012 at 4:57 am /

    Section about layout handles:

    maybe I just didn’t understood this properly but for me this wasn’t 100% clear and I thought [module_front_name] was a value from node which is not.




  28. Peter
    October 24, 2012 at 5:00 am /

    Can’t edit comments for some reason 🙁 Just delete my previous comment and keep this one.

    Section about layout handles:

    maybe I just didn’t understood this properly but for me this wasn’t 100% clear and I thought [module_front_name] was a value from frontName node which is not.




  29. Mens Boxers
    November 4, 2012 at 10:22 am /

    Excellent tutorial just what i was after

  30. A Linn
    A Linn
    December 5, 2012 at 8:24 pm /

    Thanks for the great tutorial. There seems to be so many ways to accomplish a particular layout. What’s the best way to format the home page so that the top row has two columns (slider left, video right) with the rest of the page being two-column right?

    1. Mubashir
      December 7, 2012 at 1:30 am /

      You can create a static block and put your static block inside home page….

  31. Mubashir
    December 7, 2012 at 1:24 am /

    very good explanation of the layouts and blocks…It helped me a lot to have a clear understanding about layouts and blocks in Magento

  32. Path to layout xml files in magento | Code and Programming

    […] but I have read at magebase and at magentocommerce that we can place our layout files […]

  33. Magento Homepage | 迷途花开
    February 2, 2013 at 5:50 am /

    […] Demystifying Magento’s Layout XML – Part 1 This entry was posted in Magento by admin. Bookmark the permalink. […]

  34. Jirka Chmiel
    Jirka Chmiel
    March 7, 2013 at 3:26 am /


    Thank you for great post. I have a little note:

    If you want to translate asubnode use separator . between the node names.


    <action method="addCrumb" translate="name params.label params.title">
        <label>Cart / Pay</label>
        <title>Cart / Pay</title>
  35. Comprendiendo el layout y el renderizado de los XML en Magento

    […] Artículo original en inglés […]

  36. John Yotis
    John Yotis
    June 23, 2013 at 7:19 pm /

    Excellent work. Congratulations!
    That is how MAGENTO should be explained in the official documents.

  37. diego
    January 21, 2015 at 3:57 pm /

    great article! thanks!

  38. Best tutorials for Magento | Ken Nguyen

    […] Demystifying Magento’s Layout XML – Part 1 […]

  39. Abdus Salam
    Abdus Salam
    March 20, 2016 at 11:08 pm /

    I just want to thank you. You don’t know it’s how many help me

  40. Lucio
    June 22, 2016 at 5:36 am /

    I don’t understand what is a module in this context. Any reference you can point me to? Thanks.

  41. Deepti Acharya
    Deepti Acharya
    July 22, 2016 at 9:18 pm /

    This is exactly what i needed.I have been searching for this since last 20 days.Thank u for the article… 🙂

  42. Seo Tricks Magento – Best Trick SEOBest Trick SEO

    […] Demystifying Magento’s Layout XML – Part 1 […]

  43. Ald
    August 24, 2017 at 3:25 am /


  44. Samuel L. Walley
    September 22, 2017 at 12:53 pm /

    Hey there! I must say a good job with the article. It is a really good post. I was so bad at XML and stuff because I used to think it is quite lengthy and XML with Magento was really tough for me. Then I started to read blogs about it and it really helped me through the development.The excellent tags of Magento allows easily modifying the code or editing the default layout folders. I was reading this article just before I read yours, It shares information about Magento theme development from the scratch. But I must say you’ve posted really good article. Looking forward to other posts. Thanks for sharing it.

  45. KC Team
    May 9, 2018 at 12:14 pm /

    Thanks so much for the great article.

    I must say that I like the way you explain everything so that’s it’s very easy to understand.

    Thanks so much.


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.