我想从一个特定页面中删除每个页面上调用的静态块。
目前在我的header.phtml中,我有这段代码......
<?php echo $this->getChildHtml('topMenu') ?>
这将显示我的topmenu.phtml文件的内容,其中包含以下代码...
<?php $_menu = $this->getHtml('level-top') ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('newnav')->toHtml() ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('further-menu')->toHtml() ?>
我想通过使用XML更新页面删除静态块'more-menu',使其不显示在特定页面中。
到目前为止,我已经尝试了许多方法,例如下面但没什么用。
<reference name="top.menu">
<block type="cms/block" name="further-menu">
<action method="unsetChild"><name>further-menu</name></action>
</block>
</reference>
答案 0 :(得分:0)
您可以使用
从xml中删除任何块<remove name="BLOCK NAME"/>
答案 1 :(得分:0)
看看@ Magento Store - Remove Block using Update XML
<reference name="top.menu">
<remove name="further-menu"/>
</reference>
您可能希望启用开发者模式以仔细检查您使用的是正确的块
答案 2 :(得分:0)
转到CMS页面
打开您不想显示块的页面goto显示选项卡在布局更新XML框中添加以下代码。
<reference name="top.menu">
<remove name="further-menu"/>
</reference>