Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Loading ChildHtml code from within another child? 
 
jamesrowe
Jr. Member
 
Total Posts:  10
Joined:  2009-04-21
 

I’m trying to add my breadcrumb into part of the header and since the breadcrumbs are referenced directly from the page templates I need to take out the following line…

<?php echo $this->getChildHtml('breadcrumbs'?>

... and move the functionality to the header.  I simple added the line above to the header.phtml file but nothing is rendered in the page.

Presumably breadcrumbs is not a child of header - which makes sense.  But I can’t find a suitible alternative, perhaps…

<?php echo $this->getSiblingHtml('breadcrumbs'?>

I know I can solve this by simply copying the content of breadcrumbs.phtml where I want it, but this is not a very modular solution.

I’m sure this should be simple, but the documentation is sadly lacking and searches are not throwing up anything either.

Thanks in advance.

James

 
Magento Community Magento Community
Magento Community
Magento Community
 
jamesrowe
Jr. Member
 
Total Posts:  10
Joined:  2009-04-21
 

Not the most elegant, but it works.

<?php echo $this->getLayout()->getBlock("breadcrumbs")->toHtml(); ?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top