【问题标题】:Want to add a layout in header using Magento想要使用 Magento 在标题中添加布局
【发布时间】:2014-11-10 01:23:29
【问题描述】:

我正在 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-&gt;getChildHtml('abc')

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

谢谢

【问题讨论】:

  • 任何人都可以帮助我............?它对我来说很紧急......我是magento的新手......

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


【解决方案1】:

您可以尝试将 output="toHtml" 作为新属性添加到块中。

但我不确定 abc.phtml 是否会显示您想要的位置。

让我知道这个提示是否有效。

最好, 格林戈。

【讨论】:

  • output="toHtml" 此代码将我的内容添加到
【解决方案2】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-24
    • 2012-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-05
    • 1970-01-01
    相关资源
    最近更新 更多