Skip to content

Instantly share code, notes, and snippets.

@Maksold
Last active May 28, 2021 20:02
Show Gist options
  • Save Maksold/3956702 to your computer and use it in GitHub Desktop.
Save Maksold/3956702 to your computer and use it in GitHub Desktop.
#magento #xml - local.xml boilerplate
<?xml version="1.0"?>
<layout>
<default>
<!--Root/Default Layouts-->
<reference name="root">
<!--Appending Block-->
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</reference>
<!--CSS and JS Files-->
<reference name="head">
<!--Add CSS and JS, skin Folder-->
<action method="addItem"><type>skin_css</type><name>css/styles.css</name></action>
<action method="addItem"><type>skin_js</type><name>js/functions.js</name></action>
<!--Remove CSS and JS, skin Folder-->
<action method="removeItem"><type>skin_js</type><name>scripts/functions.js</name></action>
<action method="removeItem"><type>skin_css</type><name>css/styles.css</name></action>
<!--Remove JS, js Folder-->
<action method="removeItem"><type>js</type><name>scripts/functions.js</name></action>
</reference>
<!--Header-->
<reference name="header">
<!--Append CMS Block-->
<block type="cms/block" name="header.cms.block" as="headerCmsBlock">
<action method="setBlockId"><block_id>header_cms_block</block_id></action>
</block>
</reference>
<!--Change Block's Template if some Configuration is Set-->
<reference name="catalog.topnav">
<action method="setTemplate" ifconfig="pronav/pronavconfig/pronav_status">
<template>pronav/navigation_top.phtml</template>
</action>
</reference>
<!--Magento's Default Sidebar Blocks-->
<remove name="cart_sidebar"/> <!--Cart Sidebar-->
<remove name="catalog.product.related"/> <!--Related products sidebar-->
<remove name="wishlist_sidebar"/> <!--Wishlist Sidebar-->
<remove name="catalog.compare.sidebar"/> <!--Compare Items Sidebar-->
<remove name="right.permanent.callout"/> <!--Right Callout Sample Data-->
<remove name="left.permanent.callout"/> <!--Left Callout Sample Data-->
<remove name="right.reports.product.viewed"/> <!--Viewed Products-->
<remove name="right.reports.product.compared"/> <!--Compared Products-->
<remove name="catalog.leftnav"/> <!--Layered Navigation-->
<remove name="left.newsletter"/> <!--Sidebar Newsletter-->
<remove name="right.poll"/> <!--Poll-->
<remove name="tags_popular"/> <!--Popular Tags-->
<remove name="paypal.partner.right.logo"/> <!--Paypal logo Sample Data-->
<remove name="catalogsearch.leftnav"/> <!--Layered navigation on search result page-->
<remove name="sale.reorder.sidebar"/> <!--Reorder Sidebar When User Logged, in Dashboard-->
<remove name="customer_account_navigation"/> <!--Customer Navigation-->
</default>
<!--Home Page-->
<cms_index_index>
</cms_index_index>
<!--All Cms Pages-->
<cms_page>
</cms_page>
<!--Category View-->
<catalog_category_view>
<!--Set Page Template-->
<reference name="root">
<action method="setTemplate">
<template>page/3columns.phtml</template>
</action>
</reference>
</catalog_category_view>
<!--Category View With Layered Navigation-->
<catalog_category_layered>
</catalog_category_layered>
<!--Onepage Checkout Index Page-->
<checkout_onepage_index>
</checkout_onepage_index>
<!--Onepage Checkout Success Page-->
<checkout_onepage_success>
</checkout_onepage_success>
<!--Customer Accound Pages-->
<customer_account>
<!--Adds Body Class For All Dashboard Pages - MUST when Dashboard is present-->
<reference name="root">
<action method="addBodyClass"><className>customer-account-page</className></action>
</reference>
</customer_account>
<!--Customer Logged In-->
<customer_logged_in>
</customer_logged_in>
<!--Customer Logged Out-->
<customer_logged_out>
</customer_logged_out>
<!--Product View-->
<catalog_product_view>
<!--Product Information Block-->
<reference name="product.info">
<!--Recently Viewed Products-->
<block type="reports/product_viewed" name="product.viewed" template="reports/recently-viewed.phtml" />
</reference>
</catalog_product_view>
<!--Catalogsearch Result Page-->
<catalogsearch_result_index>
</catalogsearch_result_index>
<!--Advanced Search Result Page-->
<catalogsearch_advanced_result>
</catalogsearch_advanced_result>
<!--Advanced Search Page-->
<catalogsearch_advanced_index>
</catalogsearch_advanced_index>
<!--Cart-->
<checkout_cart_index>
</checkout_cart_index>
<!--Contacts Page-->
<contacts_index_index>
</contacts_index_index>
</layout>
@Dijkie
Copy link

Dijkie commented Dec 17, 2013

Good Morning!

First of all, I'm a total newbie to magento!
By watching tutorials and visit site like this one I try to understand what is happening.

As well I used your local.xml file :) (Thank you).

Bij using your file, (put this in the simulair directory in my own (default) template folder)
the "TAGS" section keeps coming up on the home page.
I see an lot of poston the web but no clear solution other then disable the Mage_tag

After some searching I found out and adjusted, know I need to know is this the right way?
Please don't catch me on the wrong words.

On the tag.xml page I found this code:
Where it says on a 2colums-right.phtml is loading the block with name="tags_all"

<tag_list_index translate="label">
    <label>Tags List (All Available)</label>
    <!-- Mage_Tag -->
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="tag/all" name="tags_all" template="tag/cloud.phtml"/>
    </reference>
</tag_list_index>

While my homepage is using the 2colums-right.phtml right now, I add 1 line to the local.xml file like here posted:

    <remove name="cart_sidebar"/>                   <!--Cart Sidebar-->
    <remove name="catalog.product.related"/>        <!--Related products sidebar-->
    <remove name="wishlist_sidebar"/>               <!--Wishlist Sidebar-->
    <remove name="catalog.compare.sidebar"/>        <!--Compare Items Sidebar-->
    <remove name="right.permanent.callout"/>        <!--Right Callout Sample Data-->
    <remove name="left.permanent.callout"/>         <!--Left Callout Sample Data-->
    <remove name="right.reports.product.viewed"/>   <!--Viewed Products-->
    <remove name="right.reports.product.compared"/> <!--Compared Products-->
    <remove name="catalog.leftnav"/>                <!--Layered Navigation-->
    <remove name="left.newsletter"/>                <!--Sidebar Newsletter-->
    <remove name="right.poll"/>                     <!--Poll-->
    <remove name="tags_popular"/>                   <!--Popular Tags-->
    <remove name="paypal.partner.right.logo"/>      <!--Paypal logo Sample Data-->
    <remove name="catalogsearch.leftnav"/>          <!--Layered navigation on search result page-->
    <remove name="sale.reorder.sidebar"/>           <!--Reorder Sidebar When User Logged, in Dashboard-->
    <remove name="customer_account_navigation"/>    <!--Customer Navigation-->
    <remove name="tags_all" />
</default>

I add the line

Is this the ight way to do this?

Thanx a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment