Magento: The Best Way To Use Code In CMS Pages
- Category: questions, web development
We recently saw how to avoid issues with Magento editor to edit content on CMS pages (such as the home page for example) but I wanted to take the time to post a much better way to handle content in CMS pages with Magento.
You can use the editor if all you use is text and images with minor formatting. But if you have a more complex content with custom code, then it is much better to create a phtml file with your code in it (name it “page.phtml” for example) and put it here:
app/design/frontend/default/yourtheme/template/page/page.phtml
Then use this code in the CMS admin to call your content:
{{block type="core/template" template="page/page.phtml"}}
This method is the best way to use custom code in Magento CMS pages (such as the home page).
Don’t forget! Subscribe and follow!
Be sure to subscribe to the feed and follow us on Twitter for more tips, resources, and giveaways!
This is the page I made with your code:
http://newschoolacademia.com/main/index.php/testslider
I am trying to get this page working inside the CMS page:
http://newschoolacademia.com/main/Demo/index.html
Please any feedback will help.
I disable all the WYSIWYG Editor
Enable WYSIWYG Editor->Disabled Completely
Use Static URLs for Media Content in WYSIWYG for Catalog -> No
However, the HTML code is still work correctly in Description attribute. However, it works in Short Description.
I compare the attribute Short Description and Description and both have same setting. So, I believe the setting is correct but don’t know why unable to work with HTML code
Please help
Mustkara