I am calling a block left.phtml from my main store file like this:
<?php echo $this->getChildHtml('left') ?>
In the layout file this is described as:
<reference name="left">
<block type="marketplace/storeleft" name="store_left" template="marketplace/storesearch/left.phtml" />
</reference>
Till now everything is working fine. Now I want to call another block from within this block:
<div class="parlor-detail-top">
<div class="shop_bakery">
<a href="#" class="shop_now">SHOP NOW</a>
</div>
<?php echo $this->getChildHtml('rate_bakery'); ?>
</div>
I have changed the layout file for this
<reference name="left">
<block type="marketplace/storeleft" name="store_left" template="marketplace/storesearch/left.phtml" />
<block type="marketplace/storeleft" name="rate_bakery" template="marketplace/storesearch/ratebakery.phtml"/>
</reference>
But this new block is getting included after the "left" block. How do I include this new block within the "left" block and not after?
1 Answer 1
Use Parent Child Tree Structure
<reference name="left">
<block type="marketplace/storeleft" name="store_left" template="marketplace/storesearch/left.phtml">
<block type="marketplace/storeleft" name="rate_bakery" template="marketplace/storesearch/ratebakery.phtml"/>
</block>
</reference>
answered Jan 30, 2016 at 7:25
Minesh Patel
2,19314 silver badges23 bronze badges
-
It does not load the child block (rate_bakery) when I use this parent child tree structure. I checked the source also ... it just ignores this child block using this method.coderatlarge– coderatlarge2016年01月30日 08:00:37 +00:00Commented Jan 30, 2016 at 8:00
-
Paste Your Layout XML hereMinesh Patel– Minesh Patel2016年01月30日 08:12:15 +00:00Commented Jan 30, 2016 at 8:12
-
You are calling in getChildHtml('rate_bakery') in phtml of store_left block right ?Minesh Patel– Minesh Patel2016年01月30日 08:15:53 +00:00Commented Jan 30, 2016 at 8:15
-
Yes. I am calling it from within store_left block.coderatlarge– coderatlarge2016年01月30日 08:22:11 +00:00Commented Jan 30, 2016 at 8:22
-
Okay just verify xml again and make sure you have added rate_bakery block as child of store_left blockMinesh Patel– Minesh Patel2016年01月30日 08:37:55 +00:00Commented Jan 30, 2016 at 8:37
default