megwoo
6/24/2015 - 5:29 AM

Sample of local.xml file when starting a new project

Sample of local.xml file when starting a new project

<?xml version="1.0" encoding="UTF-8"?>
<layout> 
    <!-- ############# GLOBAL LAYOUT UPDATES ############# -->
    <default>
    
        <!-- Remove unwanted blocks entirely -->
        <remove name="right.poll"/>
        <remove name="right.permanent.callout"/>
        <remove name="left.permanent.callout"/>
        <remove name="paypal.partner.right.logo"/>
        <remove name="tags_popular"/>
        <remove name="catalog.compare.sidebar"/> 
        <remove name="sale.reorder.sidebar"/> 

         
        <!-- Default Head -->   
        <reference name="head">
        
        	<!-- Add fonts -->
            <block type="core/text" name="fonts">
	            <action method="setText">
	                <text>
	                	<![CDATA[
	                		<script type="text/javascript" src="http://fast.fonts.net/jsapi/9db62b6b-1ada-4e26-82b7-d8634a6ca088.js"></script>
						]]>
	                </text>
	            </action>
			</block>
			
			<!-- Add customized select dropdowns for forms -->
			<action method="addCss">
				<stylesheet>css/select2.min.css</stylesheet>
				<sort_order>10</sort_order>
			</action>
			<action method="addItem">
                <type>skin_js</type>
                <name>js/select2.min.js</name>
                <params/>
            </action>
            
            <!-- Add share this (or any outside javascript) -->
            <block type="core/text" name="share_this">
	            <action method="setText">
	                <text>
	                	<![CDATA[
	                		<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
	                		<script type="text/javascript">stLight.options({publisher: "pub_number_here", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
						]]>
	                </text>
	            </action>
		    </block>           
            
            <!-- Add custom stylesheets (not needed if using SASS) -->
            <action method="addCss">
				<stylesheet>css/styles.css</stylesheet>
				<sort_order>20</sort_order>
			</action>
            <action method="addCss">
                <stylesheet>css/global.css</stylesheet>
                <sort_order>30</sort_order>
            </action>                    
             
            <!-- Add custom javascript -->
            <action method="addItem">
                <type>skin_js</type>
                <name>js/custom.js</name>
                <params/>
            </action>
		</reference>             

         
        <!-- Top Links (account dropdown) -->
        <reference name="top.links">
            <action method="addLink" translate="label title"><label>Link Title</label>
			<url>/link-url</url> 
<title>Link Title</title><prepare/><urlParams/><position>1</position></action>
            <remove name="wishlist_link" />
			      <remove name="checkout_cart_link" />
        </reference>

        
        <!-- Default Header --> 
        <reference name="header">        
        </reference>
 
         
        <!-- Default Footer -->         
        <reference name="footer">
        	<remove name="footer_links"/>
        	<remove name="store_switcher"/>
        </reference>
 
         
        <!-- Default Root -->       
        <reference name="root">
        </reference>
         
         
        <!-- Default Left Column -->     
        <reference name="left">
        </reference>
 
     
        <!-- Default Right Column -->     
        <reference name="right">
        </reference>
         
    </default>

    
    <!-- When Customer is Logged out -->
    <customer_logged_out>
        <reference name="top.links">
        	<action method="removeLinkByUrl"><url helper="customer/getAccountUrl" /></action>
        </reference>
    </customer_logged_out>
     
    <!-- When Customer is Logged in -->
    <customer_logged_in>
        <reference name="top.links">
        </reference>
    </customer_logged_in>  
     
     
    <!-- ############# MODULE-SPECIFIC LAYOUT UPDATES ############# -->
    
    
    <!-- Add links to the customer account sidebar -->
    <customer_account>
        <reference name="customer_account_navigation">
             <action method="addLink">
                <name>email_preferences</name>
                <path>email-preferences</path>
                <label>My Email Preferences</label>
            </action>
        </reference>
    </customer_account>
     
</layout>