This is the blog for getting Idea regarding PHP, Magento, jQuery and JavaScript for Customization.

Wednesday 31 October 2012

Magento : get CMS static block using XML file


A) Create one Static Block in CMS > Static block Admin

       1.  Block Title =  heders_links
       2.  Identifier    =  heders_links
       3.  Status        =  Enable
       4.  Content     =  "Give your Custom Design Layout"
             ex.
            <ul class="header-menu">
                     <li><a href="{{store direct_url=''}}">Home</a></li>
                     <li><a href="{{store direct_url='about-magento-demo-store'}}">About Us</a></li>
                     <li><a href="{{store direct_url='catalogsearch/advanced/'}}">Advanced Search</a></li>
                     <li><a href="{{store direct_url='contacts/'}}">Contact Us</a></li>
            </ul>


B)  Copy code inside page.xml file


     <block type="cms/block" name="header_links">
                    <!--
                        The content of this block is taken from the database by its block_id.
                        You can manage it in admin CMS -> Static Blocks
                     -->
                    <action method="setBlockId"><block_id>header_links</block_id></action>
            </block>

No comments:

Post a Comment