更新处理面包屑不起作用

时间:2014-04-23 04:35:19

标签: magento magento-layout-xml

任何想法为什么以下布局更新句柄不起作用?我是否尝试将 customer_address_index 的面包屑复制到 customer_address_new customer_address_new

<customer_address_index>
<reference name="breadcrumbs">
        <action method="addCrumb">
            <crumbName>home</crumbName>
            <crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
        </action>

        <action method="addCrumb">
            <crumbName>My Account</crumbName>
            <crumbInfo><label>My Account</label><title>My Account</title><link>/customer/account</link></crumbInfo>
        </action>

        <action method="addCrumb">
            <crumbName>Address Book</crumbName>
            <crumbInfo><label>Address Book</label><title>Address Book</title><link></link></crumbInfo>
        </action>


</reference>

</customer_address_index>


<customer_address_new>
     <reference name="breadcrumbs"> <!-- Not working -->
        <update handle="customer_address_index" />
     </reference>
</customer_address_new>

<customer_address_edit>
    <update handle="customer_address_index" /> <!-- Not working also -->
</customer_address_edit>

提前致谢

1 个答案:

答案 0 :(得分:2)

我发现为什么不起作用, customer_address_new customer_address_new 不存在 ,我应该使用 customer_address_form

这里是xml代码

<customer_address_index>
<reference name="breadcrumbs">
        <action method="addCrumb">
            <crumbName>home</crumbName>
            <crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
        </action>

        <action method="addCrumb">
            <crumbName>My Account</crumbName>
            <crumbInfo><label>My Account</label><title>My Account</title><link>/customer/account</link></crumbInfo>
        </action>

        <action method="addCrumb">
            <crumbName>Address Book</crumbName>
            <crumbInfo><label>Address Book</label><title>Address Book</title><link></link></crumbInfo>
        </action>


</reference>

</customer_address_index>

<!--
Not working properly
<customer_address_form>
     <reference name="breadcrumbs"> 
        <update handle="customer_address_index" />
     </reference>
</customer_address_form>

Not working also
<customer_address_form>
    <update handle="customer_address_index" /> 
</customer_address_form>
-->

<customer_address_form>
    <reference name="breadcrumbs">
        <action method="addCrumb">
            <crumbName>home</crumbName>
            <crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
        </action>

        <action method="addCrumb">
            <crumbName>My Account</crumbName>
            <crumbInfo><label>My Account</label><title>My Account</title><link>/customer/account</link></crumbInfo>
        </action>

        <action method="addCrumb">
            <crumbName>Address Book</crumbName>
            <crumbInfo><label>Address Book</label><title>Address Book</title><link></link></crumbInfo>
        </action>


</reference>
</customer_address_form>