【问题标题】:Magento - Changing the place of block to another pageMagento - 将块的位置更改为另一个页面
【发布时间】:2014-01-24 07:14:18
【问题描述】:

我正在使用 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。但我不知道怎么做。

经过很长时间的 Google 搜索后,我发现我必须在 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 文件更改并不重要,我知道如何编辑和覆盖。

【问题讨论】:

    标签: xml magento templates layout themes


    【解决方案1】:

    在 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>
    

    【讨论】:

    • @Semih Masat 让我知道这是否适合您。
    • 我粘贴了 yourcode 之类的代码,但没有成功。
    • 布局内布局?像这样:i41.tinypic.com/33ory4n.png PS:没用。
    • 不不不布局内部布局。它们将是第一行的一个布局,它们将是一个最后关闭的布局。在第二行粘贴此默认代码
    • 顺便说一句,你能重新发送你的第一个建议吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-09
    • 2021-02-11
    • 1970-01-01
    • 2015-04-15
    • 1970-01-01
    • 2011-08-27
    • 2018-08-11
    相关资源
    最近更新 更多