xml magento xml样板文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml magento xml样板文件相关的知识,希望对你有一定的参考价值。

<?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>

以上是关于xml magento xml样板文件的主要内容,如果未能解决你的问题,请参考以下文章

如何通过xml文件导入时将图像连接到magento

xml 添加此文件以在magento中打印错误(src / errors / local.xml)

如何使用 Magento 布局 xml 文件中的操作方法

apache_conf Magento:通过事件添加布局xml,在local.xml之前直接添加布局文件

Magento 我的帐户布局 XML 问题

xml 我目前的Magento 2 PHPStorm文件模板(2016年2月)