1

I added like that in page.xml

<block type="page/html_banner" name="banner" as="banner" template="page/html/banner.phtml">
</block>

but didn't get the template.

please any one suggest me.

  • can you explain clearly.how you want – saravanavelu Jan 6 '15 at 5:07
  • i want to include a new phtml file like header I mean my file is banner.phtml – Sathish Jan 6 '15 at 5:09
  • <block type="page/html_banner" name="banner" as="banner" template="page/html/banner.phtml"><block type="page/html_banner" name="header" as="header" template="page/html/header.phtml"> </block> </block> in banner.phtml you can call $this->getChildHtml(header); – saravanavelu Jan 6 '15 at 5:09
  • I added in page.xml – Sathish Jan 6 '15 at 5:10
  • By using the above code you can call header.phtml in banner.phtml – saravanavelu Jan 6 '15 at 5:11
2
<block type="page/html_banner" name="banner" as="banner" template="page/html/banner.phtml">

  <block type="page/html_banner" name="custom" as="custom" template="page/html/custom.phtml"> 
   </block>

In banner.phtml you can call $this->getChildHtml('custom'); to access custom.phtml inside banner.phtml

(or)

Try the below code inside banner.phtml,

$this->getLayout()->createBlock('page/html_banner')->setTemplate('page/html/custom.phtml')->toHtml();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.