想要使用Magento在标题中添加布局

时间:2014-09-16 10:25:07

标签: magento magento-1.7 magento-1.8 magento-1.5 magento-1.6

我在Magento中创建一个小模块,在标题中显示一个下拉列表。我在下面添加了代码。

<reference name="header">
      <block type="page/template_links" name="abc" before="store_language" as="abc" template="abc/abc.phtml"/>
</reference>

使用此代码,我无法在标头中查看我的abc.phtml文件内容。

我不想使用下面的代码。

echo $this->getChildHtml('abc')

请帮助我如何在我的magento标题中添加没有此功能的代码。

由于

2 个答案:

答案 0 :(得分:0)

您可以尝试将output =“toHtml”添加为块的新属性。

但是我不确定abc.phtml是否会显示我想要的地方。

如果这个提示有效,请告诉我。

最佳, 外国佬。

答案 1 :(得分:0)

为什么不创建一个新的静态块并调用它,应该作为替代

<div id="NAME"><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('BLOCK')->toHtml() ?></div>