Magento在静态块内调用子html

时间:2014-04-22 08:35:04

标签: php html xml magento account

我对此有点困惑。我有

<?php echo $this->getChildHtml('accountLinks') ?>
在header.phtml下。我怎么打电话给&#39; accountlinks&#39;在管理员的新静态块中?

谢谢!

2 个答案:

答案 0 :(得分:2)

首先,在布局所有xml文件中检查任何accountLinks别名是否退出。 假设

如果我发现store_language在page.xml中退出,并在header.phtml $this->getChildHtml('store_language')中调用 ;

如果我想在下面使用的代码

中调用此文件
 echo $this->getLayout()->createBlock('page/switch')
->setTemplate('page/switch/languages.phtml')->toHtml();

您需要遵循相同的方式

答案 1 :(得分:1)

可能有相应的accountLinks.phtml模板文件。

您可以使用以下命令将其加载到静态块中

{{block type='core/template' template='path/to/accountLinks.phtml'}}

path / to / accountLinks.phtml是来自app / design / frontend / [packagename] / [theameame] / template的路径,例如:page / html / header / accountLinks.phtml