开发者

how to add content to the right structural block in magento

开发者 https://www.devze.com 2023-01-25 08:54 出处:网络
how do imanage which blocks go inside the right structural block. ie with getChildHtml(\'right\') ?> i want to add some custom code that will go on all pages that use the \"right\" stru开发者_开发

how do i manage which blocks go inside the right structural block.

ie with

getChildHtml('right') ?>

  • i want to add some custom code that will go on all pages that use the "right" stru开发者_开发问答ctural block
  • i know i can over the individual elements but i would prefer it is the elements i don't use don't get called.


You have to create a layout XML file that will update the right column with your custom blocks. If you don't know what I'm talking about, then read this


Do something like this in your layout file:

<default>
    <reference name="right">
        <!-- Adding your block(s) -->
        <block type="yourmodule/yourblock" name="yourblock" as="yourblock" />

        <!-- Removing some other default block -->
        <remove name="some.other.block.name" />
    </reference>
</default> 

This should let you control all blocks in the right column.

Hope that helps!

Thanks, Joe

0

精彩评论

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

关注公众号