PDA

View Full Version : adding stylesheets globaly to admincp


Dr.CustUmz
05-05-2014, 10:59 AM
this is in regards to my addon font awesome (https://vborg.vbsupport.ru/showthread.php?t=311049)

I'm trying to add the stylesheet to the admincp so i can use that font inside (like in my options)

I have tried adding:
@import url('../../font-awesome/css/font-awesome.min.css');
to the beginning of my control panels css file (controlpanel.css)

and I have tried adding:
<link rel=\"stylesheet\" type=\"text/css\" href=\"../font-awesome/css/font-awesome.min.css\" />
inside of includes/adminfunctions.php along with a few other files, including admincp/options.php

although i cant seem to get the icons to show up if i use them in my product xml for example
<phrase name="setting_drc_rb_gst_msg_title" date="" username="DrCustUmz" version="1"><![CDATA[<i class="fa-li fa fa-check-square"></i> Welcome Message]]></phrase>

not exactly how i want to use it but something like that.

i want to be able to use the icons in my product files, then say the product has options, in the settings i could use the icons anywhere.

or anywhere else in the admincp for that matter

Zachery
05-05-2014, 05:05 PM
You have to import both the CSS and the webfonts, which means you can't really get this to other users.

Dr.CustUmz
05-05-2014, 06:10 PM
You have to import both the CSS and the webfonts, which means you can't really get this to other users.

this is just something im doing to mess around with my admincp, and the fact that i cant figure it out only makes me want it that much more lol.

im thinking if i add the code to the php file that includes the tables on the left side of the admincp it would work... but i dug in them files looking for <table for a while and couldn't find what i was looking for.

and when i do add it to adminfunctions.php file and view the source, it does load in the source... just icons wont show up in my options =/

Zachery
05-05-2014, 06:15 PM
You'd want to add the code fromt font-awesome.min.css into the global.css file for the AdminCP style.

Update the code in the CSS to point to either local or remote font files.

Dr.CustUmz
05-05-2014, 07:18 PM
You'd want to add the code fromt font-awesome.min.css into the global.css file for the AdminCP style.

Update the code in the CSS to point to either local or remote font files.

you mean the "controlpanel.css" file inside cpstyle/mystyle/

that was the first thing i did:
@import url('../../font-awesome/css/font-awesome.min.css');

to the very beginning, it loads if i view the source but im unable to add the font (icons) in my options =/

Zachery
05-05-2014, 07:19 PM
Why not use a full URL, instead of a local one?

Dr.CustUmz
05-05-2014, 08:13 PM
ill give it a shot and let ya know =)

--------------- Added 1399325298 at 1399325298 ---------------

Update* nope no luck with
@import url('http://fortawesome.github.io//font-awesome/css/font-awesome.min.css');
nor
@import url('http://dirtrif.com/font-awesome/css/font-awesome.min.css');

inside of controlpanel.css

really seems like this should be working -_- wtf vB lol

Dr.CustUmz
05-06-2014, 04:59 AM
UPDATE* got it working =)
added stylesheet link to the copyright phrase at the bottom of every page in the admincp =)

https://vborg.vbsupport.ru/attachment.php?attachmentid=149043&stc=1&d=1399355952

now time to start having some fun with it =)

notice the checkmark icons CP Home, next to the copyright, and in my options woot woot =)