Jump to content

 

Andrey Sidorov

Member Since 26 Mar 2015
Offline Last Active Apr 13 2015 11:51 AM
-----

Posts I've Made

In Topic: How To Add Custom Css With My Changes Addon

26 March 2015 - 03:29 PM

Dear littlee,

Could you tell me hot to add custom css or js for admin panel? :grin:


This is similar to adding process for customer panel. So you should make the following:
1. Create directory with your add-on name in the "/design/backend/templates/addons/" (if it is not exist).
2. Create directory "/design/backend/templates/addons/addon_name/hooks/" (if it is not exist).
3. Create directory with for index hooks "/design/backend/templates/addons/addon_name/hooks/index/" (if it is not exist).
4. Create post- or pre-hook file for styles or scripts. For styles it should be styles.pre.tpl or styles.post.tpl and for scripts it sould be scripts.pre.tpl or scripts.post.tpl. Do not use override hook because this will rewrite all that contain between hook open and hook close tags.
5. Open the created files and add the following:
a) for styles (if you use less, use the "less" instead of "css"):
<code>{style src="addons/addon_name/style.css}</code>
B) for scripts:
<code>{script src="js/addons/addon_name/script.js}</code>

Please be sure, that you have created the Style and Script files that you added in these files.
CSS files should be located here:
"/design/backend/css/addons/addon_name/"
JS files should be located here:
"/js/addons/addon_name/"

If you need an additional information about add-on creation you can read the official documentation:
http://docs.cs-cart....s/advanced.html

I hope, that my message help you.

Have a nice day,
Andrey.