因为我的模块在覆盖模块之前加载,所以不能覆盖块布局

时间:2014-09-05 14:47:41

标签: magento

我试图在同一主题中使用我自己的块覆盖属于另一个模块的块。

另一个扩展布局:

    <reference name="content">
        <block type="opc/wrapper" name="es.checkout.container" template="opc/wrapper.phtml">

                <!--  LOGIN FORM  -->
                <block type="opc/onepage_login" name="checkout.onepage.login" as="login" template="opc/onepage/login.phtml">
                    <block type="customer/account_forgotpassword" name="forgotPassword" template="opc/customer/form/forgotpassword.phtml"/> 
                </block>
                <!-- BILLING FORM -->
                <block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="opc/onepage/billing.phtml"/>

                <!-- SHIPPING FORM -->
                <block type="checkout/onepage_shipping" name="checkout.onepage.shipping" as="shipping" template="opc/onepage/shipping.phtml"/>

我的布局:

<opc_index_index>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/doniking/jne/iwd_opc.js</name></action>
    </reference>
    <reference name="es.checkout.container">
        <action method="setTemplate">
            <template>doniking/jne/iwd/opc/wrapper.phtml</template>
        </action>
    </reference>
    <reference name="checkout.onepage.billing">
        <action method="setTemplate">
            <template>doniking/jne/iwd/opc/billing.phtml</template>
        </action>
    </reference>

我的布局在另一个模块布局之前由magento加载,因此块不会覆盖它。 如何在覆盖的块之后加载它?

我不想使用

<Depends />

因为我的模块不需要其他模块。

1 个答案:

答案 0 :(得分:1)

您需要按字母顺序在其他第三方模块之后命名模块(因为模块按字母顺序加载除非使用取决于设置加载顺序),或者如果您不能这样做,那么使用depends是您唯一可行的选项

如果您不希望在自己的模块布局文件中定义布局,那么您可以使用local.xml,它将在所有核心和第三方模块布局文件之后加载。