-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.

1
  • 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. Commented Sep 23, 2014 at 5:44

1 Answer 1

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.

1
  • yes it is working but what if i want some module field in cms page using file.phtml Commented Jan 25, 2017 at 10:54

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.