i need to add php code in cms-page with name "page1" and url ="page1"

I created a file "file.phtml" in public_html/gas1/app/design/frontend/default/ma_greatshop/template/cms/file.phtml

where i have to insert php code and how to call it in cms page.

please guide me clearly.

thanks a lot in advance.

  • hi @moose thanks a lot for reply. as that question related to contact form, i got some confusions. as i am beginner in magento , please guide me to find solution. – Baby in Magento Sep 23 '14 at 5:44

If you don't understand the answer in the duplicate question, here's a bit more information.

You've already created your template file (file.phtml). Within your template file, you can call the php code you'd like to execute within the php parameters, namely:

    //execute your php code here

Once you're satisfied, add the following call to your CMS page

{{block type="core/template" template="cms/file.phtml"}}

Save your changes to the CMS page & reload, you should be all sorted now.

  • yes it is working but what if i want some module field in cms page using file.phtml – Amitesh Kumar Jan 25 '17 at 10:54

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