-1

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.

Baby in Magento
  • 3,167
  • 16
  • 83
  • 221
  • 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 05:44

1 Answers1

2

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:

<?php
    //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.

Moose
  • 7,495
  • 7
  • 48
  • 91