开发者

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

开发者 https://www.devze.com 2023-03-03 21:55 出处:网络
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 getChi

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

精彩评论

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