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!
<reference name="left">
<block type="core/template" before="-" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
</reference>
Here some other ways to order blocks.
To display as the First block:
before="-"
To display as the last block:
after="-"
To display before any other block:
before="block_name"
To display after any other block:
after="block_name"
Thanks so much for this post!...
Thanks so much for this post! You saved my life! This totally makes sense now
Cleared up the problem I had...
Cleared up the problem I had in seconds! Thanks for the useful post
Christopher, Glad I can help!...
Christopher, Glad I can help!
Thanks!! It's so simple once...
Thanks!! It's so simple once you know it
.
Thanks a lot man!!...
Thanks a lot man!!
Thanks!...
Thanks!
Thanks a lot Richard, one...
Thanks a lot Richard, one question. i have Most Popular blocks on the left display more than 10 products how can i make it only 5?
I have been looking all over...
I have been looking all over for this... I am too used to working with OsCommerce I think. Thanks for the help here.
A great help thank you....
A great help thank you.
Thank you so much for this,...
Thank you so much for this, it can save me a lot of time brilliant.
Very helpful with magento...
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
Would be able to tell me how...
Would be able to tell me how to set order of a widget in the felt column?
thanks
Your site contain a many...
Your site contain a many useful information, thanks.
Post new comment