Magento – Re-ordering Block items

Magento has lots of blocks that display in the left and right columns (based on your layout). Changing the order in which they are displayed or sorted is easy. Navigate to the folder “app\design\frontend\default\YOUR_THEME\layout”. In this folder, there are several XML files which are called Layouts.

Magento Layouts are the tools with which you can assign content blocks to each structural block you create. Layout exists in the form of XML text-file and by modifying the layout you are able to move blocks around in a page and assign templates to the content blocks to produce markup for the structural blocks.

To change the order, find a block you want to change. So if I wanted to display the products compared side box first in my left column, I would do by adding before=”-” as an attirbute to it’s xml node. Now, save it and upload. That’s it!

Here some other ways to order blocks.

To display as the First block:

To display as the last block:

To display before any other block:

To display after any other block:

 

17 thoughts on “Magento – Re-ordering Block items”

  1. Very helpful with magento core blocks, how do I get this to work with custom blocks, I want the tags block to appear last in my left column, I changed the layout file to read;

    refreshed and dumped cache, block still not appearing after the left_column_payment block?

    Any help would be appreciated.

    thanks

  2. Hi,

    Thanks for the post very helpful, playing with before/after but still can’t get the blocks to get exactly where I want them!!

Leave a Reply

Your email address will not be published. Required fields are marked *