Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Customizing Magento Layouts with xml

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 591
    Comment on it

    In magento layouts are used to display contents of each page using layout.xml which we will found in app/design/frontend//default/layout. Each module have it's own layout file e.g. customer module has customer.xml and catalog module have catalog.xml etc. If we check these files , we will see different tags which contains different blocks. These layout files contains structural block and content block which decides which contain to be displayed on page. Sometime we need to update those block with our custom blocks so here I am explaining how we can do that:-

    create local.xml in the layout folder of the custom theme used. With local.xml you don't have to edit the layouts file of each module this file will update all blocks from one file. e.g. in product detail you want to change the file to display detail below is the layout.xml content

    <?xml version="1.0" ?>
    <layout version="0.1.0">
        <default>
            <reference name="<existing_reference>">
                <block type="core/template" name="newreference" template="newfile.phtml">
            </block></reference>
        </default>
    </layout>
    

    where <existing_reference> is replaced by the reference you want to edit e.g block name product.info.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: