1

I am trying to call a phtml file on every page in magento 1 head section is their any way we can perform it in magento 1 ? I am using a theme.

2

If you want to add phtml on all pages we can add it using layout

Create:

app/design/frontend/{Package}/{theme}/layout/local.xml

<?xml version="1.0"?>
<layout version="0.1.0">
<default>
   <reference name="before_body_end">
      <block type="core/template" name="test.name" template="page/test.phtml"/>
   </reference>
</default>
</layout>

Noe create phtml at:

app/design/frontend/{Package}/{theme}/template/page/test.phtml

<?php echo "here"; ?>

Hope above will help!

| improve this answer | |
  • i want to add phtml in Head tag – Hamendra Sunthwal Jul 23 at 8:46
  • You can use <reference name="head"> instead of <reference name="before_body_end">. – Pawan Jul 23 at 9:13
  • Can we call this phtml file using module ? – Hamendra Sunthwal Jul 29 at 11:16

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.