【问题标题】:Magento, how to add block inside other block e.g. name="header" blockMagento,如何在其他块内添加块,例如名称=“标题”块
【发布时间】:2014-11-05 05:29:18
【问题描述】:

在我的 local.xml 我有:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <reference name="header">
            <block type="core/template" name="asdasd" as="asdasd" output="toHtml" template="newblock.phtml"/>
        </reference>    
</default>
</layout>

无论我在 'reference name=" "' 中放什么,这段代码都会让我的块显示在页面底部

如何在不是 type="core/text_list" 的特定块内生成块。 我不想对 .phtml 文件进行任何更改。

【问题讨论】:

    标签: magento block


    【解决方案1】:

    嘿,只需删除使用以下代码的output="toHtml"call any position

    &lt;?php echo $this-&gt;getChildHtml("asdasd");?&gt;header.phtml根据你的愿望位置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-24
      • 1970-01-01
      • 2019-01-01
      • 1970-01-01
      • 2022-06-12
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      相关资源
      最近更新 更多