我正在使用Magento var-1.6
我需要将新模板(.html)文件添加到函数中。我在XML中添加了一个块,但页面显示了两次加载的模板。
这是我在customer.xml中添加的代码
<customer_account_customeraccount translate="label">
<label>Customer Account Page</label>
<!-- Mage_Customer -->
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="core/template" name="customer_account_page" template="persistent/customer_account.phtml" />
</reference>
</customer_account_customeraccount>
有人能找到问题吗?
答案 0 :(得分:1)
我是否正确地猜测您正在尝试替换块customer_account_page
的模板?
在这种情况下,您应该能够:
<customer_account_customeraccount translate="label">
<label>Customer Account Page</label>
<!-- Mage_Customer -->
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="customer_account_page">
<action method="setTemplate"><template>persistent/customer_account.phtml</template></action>
</reference>
</customer_account_customeraccount>