Magento商店-使用更新XML删除块 [英] Magento Store - Remove Block using Update XML
本文介绍了Magento商店-使用更新XML删除块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在模板文件中使用以下代码在我的左侧边栏中显示一个静态块:
I am using this code in my template file to display a static block in my left sidebar:
<?= $this->getLayout()->createBlock('cms/block')->setBlockId('leftSB1')->toHtml() ?>
我想从我的CMS页面之一中排除该屏蔽.我该怎么做?
I would like to exclude the block from one of my CMS pages. How do I do this?
我认为这需要向布局更新XML"部分添加代码,但是我不确定到底是什么.
I think it requires adding code to the 'Layout Update XML' section but I'm not sure what exactly.
推荐答案
在您的布局中添加该块:
Include the block in your layout instead:
<cms_page>
<reference name="left">
<block type="cms/block" name="leftSB1">
<action method="setBlockId"><id>leftSB1</id></action>
</block>
</reference>
</cms_page>
然后在侧边栏中添加$this->getChildHtml('leftSB1')
(如果您不自动包含子级的话).
And then $this->getChildHtml('leftSB1')
in your sidebar, if you're not including children automatically.
(然后将其从上一个答案中的特定页面中删除)
(and then remove it from the particular page as in the previous answer)
这篇关于Magento商店-使用更新XML删除块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文