我想复盖侧边栏。我自己的模块中的wishlist模块的phtml文件。

请指导我。

谢谢,

有帮助吗?

解决方案

我猜你想改变 sidebar.phtml.

在自定义模块中创建新的布局文件:

对于这种情况。您需要创建一个前端布局文件 customwishlist.xml 从这个自定义模块像这样。

<?xml version="1.0" ?>
<config>
    <modules>
        <Amit_Custommodule>
            <version>1.0.0</version>
        </Amit_Custommodule>
    </modules>
    <!-- start of routers 
    -->
    <frontend>
        <layout>
            <updates>
                <custommodule>
                    <file>customwishlist.xml</file>
                </custommodule>
            </updates>
        </layout>
    </frontend>
</config>

在新布局文件中更改模板文件

然后在 customwishlist.xml 文件使用 siderbar.phtml 名称及用途 setTemplate 功能集模板。

<?xml version="1.0"?>
<layout version="0.1.0">
<!--
Default layout, loads most of the pages
-->
    <default> <!--  wishlist_sidebar sidebar block name define at wishlist.xml -->
        <reference name="wishlist_sidebar">
              <action method="setTemplate"><template>youpath/customsider.phtml</template></action>
        </reference>
    </default></layout>

许可以下: CC-BY-SA归因
scroll top