Layout XML for Static blocks position-1 position-2 etc.

Hi,

honestly this is a little bit a "beginner" question. But as I’m new into Magento and still learning a lot, can somebody give me a hint what I have to add to the Layout XML to display the position-1 (topbanner) static block?

Currently I have this which works fine for the Slideshow, the ProductSlider and the featured products.

Code:

<reference name="mass-top">    
        <block type="joomlart_jmslideshow/list" name="jmslideshow" template="joomlart/jmslideshow/list.phtml" />
        <block type="joomlart_jmproductsslider/list" name="jmproductsslider" template="joomlart/jmproductsslider/list.phtml" /> 
        <block  type="joomlart_jmproducts/list"  name="home.jmproducts.list"    template="joomlart/jmproducts/list.phtml" >
             <action method="setData"><name>title</name><value>Featured Products</value></action>
             <action method="setData"><name>mode</name><value>featured</value></action> 
         </block>
</reference>

Reading this article on How to create Static block I don’t understand how I must edit this. If I add it like this my page crashes

Code:

<reference name="right">            
            <block type="cms/block" name="position-1">
                <action method="staticblock">
                    <identifier>position-1</identifier>
                </action>
            </block>
</reference>

I also tried

Code:

<reference name="right">            
            <block type="cms/block" name="topbanner">
                <action method="staticblock">
                    <identifier>topbanner</identifier>
                </action>
                
            </block>
      </reference>

Page crashes with this error

Code:

Invalid method Mage_Cms_Block_Block::staticblock(Array
(
    [0] => topbanner
)
)

Trace:
#0 [internal function]: Varien_Object->__call('staticblock', Array)
#1 [internal function]: Mage_Cms_Block_Block->staticblock('topbanner')

Any help would be appreciated.

Thanks
Daniel

2 answers

Profile photo of Sherlock 0.00 $tone September 16, 2013
Public

Hi daniel,

you should try with this block

HTML Code:

              <reference name="right"> 
                   <block type="cms/block" name="position-1">
						<action method="setBlockId"><block_id>position-1</block_id></action>
					</block>
                    </reference> 

Hope you get the ideal !

#1

This question is now closed

Written By

Comments