Magento,如何在其他块中添加块,例如name =“header”块

时间:2014-09-11 10:00:44

标签: magento block

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

此代码使我的块显示在页面底部,无论我放在哪里&#39;引用名称=&#34; &#34;&#39;

如何在特定块内生成块,该块不是类型=&#34; core / text_list&#34;。 我不想在.phtml文件中进行任何更改。

1 个答案:

答案 0 :(得分:0)

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

<?php echo $this->getChildHtml("asdasd");?>根据您的愿望位置header.phtml