我想覆盖用户帐户索引模板,但是当我这样做时,内容会重复。
这是我的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>
和我的基本custommer.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>
如果我使用name =“content”而不是name =“my.account.wrapper”来插入内容,则不会重复。
答案 0 :(得分:0)
我发现了我的问题: 在customer.xml中已经有customer_account_index句柄,所以我从local.xml中删除了它