How add div to Magento page
I'm not sure how to add a div to a particular page in Magento. I'm using the default modern theme as a base. It has div's like header, main-container, footer etc but i'm in need of adding my own div within main-container. I haven't been able to work this out. I'm guessing i need to edit开发者_高级运维 some phtml file? Thanks for your input.
Magento theming is non-trivial. The best place to start learning is the official Magento Knowledge Base.
You have to edit one of the template files. Yes, it's one of the .phtml files located in your template folder, on app/design/frontend/default/default/page/ and here you choose the appropriate template file that you want to edit.
This is relatively simple.
First, you must find the file which you will need to modify.
There is a handy way of finding out which file you need to modify by turning on something called Template Path Hints.
There's a handy video here: http://www.magentocommerce.com/blog/template-path-hints-tutorial-video/ that shows you how to turn it on and how to use it.
After that, all you need to do is find the appropriate template file, and add any code you need to it.
Also, make sure that if the file that you need is not in your theme's folder, copy it from the default/default or base/default location to the relevant folder in your themes dafault/[yourthemesnamehere] location.
If you're willing to do away with the silly WYSIWYG editor for page content, the solution is simple. There is no need to muck around with source files or themes.
Navigate to System -> Configration. Click the "Content Management" panel on the left. Under "Enable WYSIWYG Editor", select "Disabled by Default".
You should be able to insert arbitrary HTML content into your page now.
精彩评论