How to load custom javascripts and style sheets to specific CMS Pages

Posted by Labels: at

In most cases, you may want to run a promotion, which might require you to add custom styling sheet and javascripts files that do not need to be loaded on any other CMS page.

For this task, simply navigate to your Magento Admin panel,

CMS >> Pages >> Select your page >> open Design (under the Page Information Menu not the "Page Information" tab).



On the Layout Update XML text-area, add xml script to pull in your custom style sheet and javascript. Magento will load these files only on that CMS page.



 But if you want add custom css and js on all pages of your store, you need to use local.xml (Read: local.xml for beginners).

Note: Your custom CSS and JS files need to be located on your Skin's Theme folder.
skin/frontend/package_name/theme_name/
This is where magento will look for your files, in the /css,  /images and /js folder.

I hope this article was helpful to you, please leave your question/s on the comments section below and I will do my best to answer back.



Post a Comment

Back to Top