Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Block order
 
peterbergman
Jr. Member
 
Total Posts:  13
Joined:  2013-01-03
 

Hi,

I am dynamically adding a block to the <head>-section. Is there any way to control the order or position that the block will be placed at within the <head>-section?

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
      <
reference name="head">
        <
block type="core/template" name="myblock" as="myblock" template="mycompany/myblock.phtml"/>
      </
reference>
    </default>
</
layout>

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anshu Mishra
Sr. Member
 
Total Posts:  101
Joined:  2012-04-23
India
 

You can try using after and before keywords in block type element to adjust the block position.
see below examples

<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>

<
block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>

before: Used to position the block before a block with the name specified in the value. If “-” value used the block is positioned before all other blocks of its level of block nesting.

after: Used to position the block after a block with the name specified in the value. If “-” value used the block is positioned after all other blocks of its level of block nesting.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top