Magento复制内容块
我想覆盖用户帐户索引模板,但这样做时,内容会重复 这是我的local.xmlMagento复制内容块,magento,magento-1.7,Magento,Magento 1.7,我想覆盖用户帐户索引模板,但这样做时,内容会重复 这是我的local.xml <customer_account_index> <label>Customer My Account Dashboard</label> <update handle="customer_account"/> <reference name="root"> <action method="setTemplate
<customer_account_index>
<label>Customer My Account Dashboard</label>
<update handle="customer_account"/>
<reference name="root">
<action method="setTemplate">
<template>page/1column.phtml</template>
</action>
</reference>
<remove name="left"/>
<remove name="breadcrumbs"/>
<reference name="my.account.wrapper">
<block type="customer/account_dashboard" name="customer_account_dashboard" template="customer/account/dashboard.phtml">
<block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
<block type="customer/account_dashboard_info" name="child_account_dashboard_info" as="childinfo" template="customer/account/dashboard/mychild.phtml"/>
</block>
</reference>
</customer_account_index>
客户我的帐户仪表板
第/1页column.phtml
和我的基本customer.xml
<customer_account translate="label">
<label>Customer My Account (All Pages)</label>
<!--remove name="catalog.compare.sidebar"/>
<remove name="sale.reorder.sidebar"/-->
<!-- Mage_Customer -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="content">
<block type="page/html_wrapper" name="my.account.wrapper" translate="label">
<label>My Account Wrapper</label>
<action method="setElementClass"><value>my-account</value></action>
</block>
</reference>
<reference name="left">
<block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
<action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
<action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
<action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
</block>
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
</block>
<block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
<remove name="tags_popular"/>
</reference>
</customer_account>
客户我的帐户(所有页面)
第页/2列-left.phtml
我的帐户包装
我的帐户
账户客户/账户/账户仪表板
账户\编辑客户/账户/编辑/账户信息
地址簿客户/地址/地址簿
simplecheckout/cart\u item\u rendercheckout/cart/sidebar/default.phtml
groupedcheckout/cart\u项目\u渲染器\u groupedcheckout/cart/sidebar/default.phtml
configurablecheckout/cart\u项目\u渲染器\u configurablecheckout/cart/sidebar/default.phtml
如果我使用name=“content”而不是name=“my.account.wrapper”插入内容,它将不会重复。我发现了我的问题:
在customer.xml中,customer\u account\u索引句柄中已经有,因此我将其从local.xml中删除
<customer_account_index>
<label>Customer My Account Dashboard</label>
<update handle="customer_account"/>
<reference name="root">
<action method="setTemplate">
<template>page/1column.phtml</template>
</action>
</reference>
<remove name="left"/>
<remove name="breadcrumbs"/>
<reference name="my.account.wrapper">
<block type="customer/account_dashboard" name="customer_account_dashboard" template="customer/account/dashboard.phtml">
<block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
<block type="customer/account_dashboard_info" name="child_account_dashboard_info" as="childinfo" template="customer/account/dashboard/mychild.phtml"/>
</block>
</reference>
</customer_account_index>