Universal WebTech
  • Home
  • About US
    • Our Team
    • Privacy Policy
    • Our Clients
    • Terms of use
  • Service
    • Web Development
    • E-Commerce
    • Android Development
    • UI UX Design
  • Our Portfolio
  • Career
  • Blogs
contact
hamburger

Call phtml file in Magento

1) Magento: call phtml file in CMS page.

When you want to display dynamic content on home page or any other CMS page. You just need to create block of specific module which create an object of that module and call predefined methods of that module to fetch date and call that modules phtml file.

Below is code by using you can call phtml file in CMS page.

{{block type="core/template" template="templateFolder/your_template.phtml"}}

2) Magento: call phtml file in static block.

You can use same syntax as CMS page

{{block type="core/template" template="templateFolder/your_template.phtml"}}

3) Magento: call one phtml file in another phtml file.

To call any phtml fine in another phtml file you just need to add below code in phtml file.

echo $this->getLayout()->createBlock('core/template')->setTemplate('templateFolder/your_template.phtml')->toHtml();

4) Magento: call phtml file using XML file.

To call any phtml file using XML you need to add below code in reference block where you want to show that block.
i.e if you want to add phtml file in footer at that time you need to add below code in <reference name=”footer”> in page.xml

<reference name="footer">
<block type="core/template" name="unique_name" template="templateFolder/your_template.phtml"/>
</reference>

Universal WebTech

Universal WebTech IT Solutions is a leading web and mobile development company in Ahmedabad, India that believes in winning trust of its clients through 100% quality service and time-oriented work.

Company

  • About us
  • Careers
  • FAQs
  • Testimonials
  • Blogs
  • Our team

Service

  • Web Development
  • Android Application Development
  • eCommerce Web Development
  • Open Source Customization
  • UI / UX / Logo Design Services

Copyright © 2025 Universal WebTech

  • Terms of use
  • Privacy Policy