Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml Magento覆盖布局文件会导致被覆盖的布局重复_Xml_Magento_Layout - Fatal编程技术网

Xml Magento覆盖布局文件会导致被覆盖的布局重复

Xml Magento覆盖布局文件会导致被覆盖的布局重复,xml,magento,layout,Xml,Magento,Layout,好的,我试图覆盖另一个扩展名的布局文件。我正在使用Magento Enterprise 1.13 这是我的config.xml: <config> <frontend> <layout> <updates> <mymodule> <file>mymodule.xml</file>

好的,我试图覆盖另一个扩展名的布局文件。我正在使用Magento Enterprise 1.13

这是我的config.xml:

<config>
    <frontend>
        <layout>
            <updates>
                <mymodule>
                    <file>mymodule.xml</file>
                </mymodule>
            </updates>
        </layout>
    </frontend>
</config>

mymodule.xml
然后在design/frontend/enterprise/myteme/layout/mymodule.xml中:

<?xml version="1.0"?>
<layout version="0.1.0">       
    <affiliateplus_default>
        <update handle="page_two_columns_left" />
        <reference name="left">
            <block type="affiliateplus/account_navigation" before="-" name="account_navigator" template="affiliateplus/navigation.phtml">
                <action method="setNavigationTitle">
                    <title helper="affiliateplus/account/getNavigationLabel" />
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>balance</name>
                    <path>affiliateplus/inddsafdsex/paymentForm</path>
                    <label helper="affiliateplus/account/getBalanceLabel" />
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>6</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>home</name>
                    <path>affiliateplus</path>
                    <label>Affiliate Home</label>
                    <disabled>0</disabled>
                    <order>10</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>login</name>
                    <path>affiliateplus/account/login</path>
                    <label>Login</label>
                    <disabled helper="affiliateplus/account/customerLoggedIn" />
                    <order>20</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>register</name>
                    <path>affiliateplus/account/register</path>
                    <label>Signup</label>
                    <disabled helper="affiliateplus/account/isRegistered" />
                    <order>30</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>banners</name>
                    <path>affiliateplus/banner/list</path>
                    <label><![CDATA[Banners & Links]]>
                    </label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>40</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>refers</name>
                    <path>affiliateplus/refer/index</path>
                    <label><![CDATA[Refer Friends]]>
                    </label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>43</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>materials</name>
                    <path>affiliateplus/index/materials</path>
                    <label>Materials</label>
                    <disabled helper="affiliateplus/config/disableMaterials" />
                    <order>100</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>sales</name>
                    <path>affiliateplus/index/listTransaction</path>
                    <label>Commissions</label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>110</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>payments</name>
                    <path>affiliateplus/index/payments</path>
                    <label>Withdrawals</label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>120</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>referrers</name>
                    <path>affiliateplus/index/referrers</path>
                    <label>Traffics</label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>180</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>edit</name>
                    <path>affiliateplus/account/edit</path>
                    <label>Settings</label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>190</order>
                </action>
                <action method="addLink" translate="label" module="affiliateplus">
                    <name>logout</name>
                    <path>affiliateplus/account/logout</path>
                    <label>Logout</label>
                    <disabled helper="affiliateplus/account/accountNotLogin" />
                    <order>200</order>
                </action>
            </block>
        </reference>
    </affiliateplus_default>    
</layout>

平衡
附属许可证/INDDSAFDEX/paymentForm
6.
家
附属物
附属住宅
0
10
登录
affiliateplus/帐户/登录
登录
20
登记
附属许可证/账户/登记簿
报名
30
横幅
附页页/横幅/列表
40
指
附页页/参考/索引
43
材料
附属品/索引/材料
材料
100
出售
affiliateplus/index/listTransaction
佣金
110
付款
附加费用/索引/付款
取款
120
推荐人
附属许可证/索引/推荐人
交通
180
编辑
附属程序/帐户/编辑
设置
190
注销
附属许可证/账户/注销
注销
200

然而,当我刷新页面时,我会看到两个导航窗格。一开始我以为我只是在附加已经存在的一个。然而,当我改变我的想法时,这两种想法都会出现。我所能想到的是,它正在拉入我的布局…然后拉入他们的布局,看到我的覆盖并再次拉入我的布局。就个人而言,这是我第一次尝试这样做,所以我很可能是做错了,但我找不到任何帮助。谢谢你的帮助/评论。

我找到了答案:

我真正的问题是我对引用和块的了解不够

我的技术问题是,我引用了一个块,然后用不同的名称创建了一个新块。“Left”块还包含一个版本的导航栏。这导致菜单重复

我的最终代码如下所示:

    <affiliateplus_default>

        <block type="affiliateplus/account_navigation" before="-" name="account_navigator" template="affiliateplus/navigation.phtml">
            <action method="setNavigationTitle">
                <title helper="affiliateplus/account/getNavigationLabel" />
            </action>
            <action method="addLink" translate="label" module="affiliateplus">
                <name>balance</name>
                <path>affiliateplus/inddsafdsex/paymentForm</path>
                <label helper="affiliateplus/account/getBalanceLabel" />
                <disabled helper="affiliateplus/account/accountNotLogin" />
                <order>6</order>
            </action>

            ......

    </affiliateplus_default>

平衡
附属许可证/INDDSAFDEX/paymentForm
6.
......
如果我只想添加一个链接,而不是完全覆盖整个块,我可以执行以下操作:

    <affiliateplus_default>
      <reference="account_navigator">
        <action method="addLink" translate="label" module="affiliateplusext">
            [Link attributes]
        </action>
      </reference>
    </affiliateplus_default>

[链接属性]
我希望这能帮助刚刚起步的其他人。谢谢