Monday, September 22, 2014

Add own #php code in #magento cms

Problem:   
You are working in a magento Site, and you need to add a own php page with a custom code to make something different that magento do. For example, to add an own file download manager.

 Solution:    

Magento don't allow to use warpeed as jomla do in a ease way, magento could be more powerfull thant other cms, but it required more development skill than cms like joomla, drupal, etc...
To add you php file in magento follow that steps:
1.- Open template path hints to see where you need to put your php file.
2.- we will put it on: frontend/base/default/template/contacts and upload your file.
3.-  Our file will be named: customerfilemanager.phtml (take care on phtml extension), you can use php code inside as well as on php one.
4.-  Create a new Magento CMS page and add that line:
{{ block type="core/template" name="contact" form_action="/contacts/index/post" template="contacts/customerfilemanager.phtml" }}
5.- that's all, now develop your php code in customerfilemanager.phtml and your visitor will see it on magento CMS page.
Source:   http://sarathlal.com/add-custom-php-code-in-magento-cms-page/ 
  
 

No comments:

Post a Comment