开发者

Magento - display block but only show when I call it with getChildHtml

I have created a block and I have placed it in to the layout xml and it is showing correctly in my theme. My problem is that I actually don't want it to display until I explicitly call it with getChildHtml('myblock').

My block xml looks like this:

<block type="page/html" name="myblock" as="myb开发者_开发百科lock" template="page/html/myblock.phtml"/ >

Anyone have a clue how to achieve this?

Thanks


Place your block inside another that is neither a core/list type nor calls $this->getChildHtml('') (note the empty string). That way it will not be shown automatically and you are free to call it at your discretion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜