Reputation: 5824
I want to include external PHP script in Magento CMS Pages
e.g.
**http://myhost/magento/custom/script.php**
<?php echo "hello"; ?>
Result on Magento Page should be: "hello
"
What would be the simplest way to do this?
Upvotes: 3
Views: 5509
Reputation: 6186
The best way would probably be via the Layout Update XML section (on the design tab). You can either create a new block for your template php file, or use Mage_Core_Block_Template
. Add this:
<reference name="content">
<block type="core/template" name="my_template" template="pat/to/your/template" after="cms_page" />
</reference>
Upvotes: 8
Reputation: 2004
OR
You can use curly braces syntax in order to include .phtml file where you can write your PHP code as:
{{block type="core/template" name="my-template" template="path/to/your/template.phtml"}}
Thanks
Upvotes: 4