Magento - 将块的位置更改为另一页

时间:2014-01-06 19:15:50

标签: xml magento templates layout themes

我正在使用MA2 Juno主题并尝试将默认结帐块移至另一个地方。

喜欢这个

之前:http://i42.tinypic.com/2ptw8ps.png 之后:http://i42.tinypic.com/oausdw.png

为此,我发现我必须移动这个

<?php echo $this->getChildHtml('topBlock1') ?>

从header.phtml到topMenu.phtml的代码块

但是在我改变后,它没有奏效。我想我需要以某种方式告诉magento topBlock1.phtml是topMenu.phtml的ChildHtml。但我不知道如何。

经过一段很长的谷歌搜索后,我发现我必须使用local.xml文件。

我做了类似的事情,但没有奏效。你能帮助我吗?

<reference name="topMenu">
        <block name="top.block1" template="page/html/topBlock1.phtml" type="page/html_topblock1" as="topBlock1">
          <label>Top1 blocks</label>
        </block>
</reference>

PS:CSS文件更改并不重要我知道如何编辑和覆盖。

1 个答案:

答案 0 :(得分:0)

在local.xml文件中尝试此操作

<layout version="0.1.0">
<default translate="label" module="page">
        <label>All Pages</label>
        <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
            <block type="page/html_header" name="header" as="header">
                <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    <label>Navigation Bar</label>
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
                    <block name="top.block1" template="page/html/topBlock1.phtml" type="page/html_topblock1" as="topBlock1">
                        <label>Top1 blocks</label>
                    </block>
                 </block>
            </block>
        </block>
    </default>  
</layout>
相关问题