if my-page
is a cms page and you want to show your custom block only in this cms page, then this is what you need to include a custom block just below the breadcrumb block.
1. Define your custom block
File : app\design\frontend\[package]\[theme]\layout\local.xml
<cms_page_view> <!-- layout update handle -->
<reference name="root"> <!-- parent block of our custom block -->
<block type="core/template" name="my.custom.top.block" as="my_custom_top_block" template="custom/template.phtml" /> <!-- definition of custom block -->
</reference>
</cms_page_view>
This code snippet defines our block and include it in root
block in the case of a cms page rendition. This means this block will be available when a cms page is rendered in frontend. You need to include the block inside root
block because it is the block which holds all structural blocks and breadcrumb
block is a structural block. Obviously your block is also a structural block.
2. Specify Where should Custom Block Appear
This is the next important step. Defining a block will not render your block automatically. You need to specify where should it appear. For that you need to open the root template
and add the below code there
File : app\design\frontend\[package]\[theme]\template/page/[root-template].phtml
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<?php echo $this->getChildHtml('my_custom_top_block') ?>
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
</div>
Here [root-template].phtml
would be the active root template in your theme. Eg : 1column.phtml
, 2columns-left.phtml
etc. It would be good if you add the line <?php echo $this->getChildHtml('my_custom_top_block') ?>
just below breadcrumb
call in every root templates as I shown above (root templates are phtml files which are avaialable in template/page
folder).
3. Define your custom block template
This is the last step. Go ahead and create a custom block template which we have specified in our layout udpate.
File : app\design\frontend\[package]\[theme]\template/custom/template.phtml
<div> UREKKAAAA </div>
Now clear the cache and load the page again. You will see UREKKAAAA
just below breadcrumb.