solved Extending jrCore Icons

TiG
TiG
@tig
4 years ago
184 posts
I know we can extend (and override) the core icons by including the appropriate files in the icon_black and icon_white folders in a skin's img folder.

Is there a likewise easy means to add new icons through a module?

In particular, I have a module that would like to introduce and then use a new icon (as if the icon were part of the core set).

Thanks.


--
TiG

updated by @tig: 08/31/20 07:55:36AM
brian
@brian
4 years ago
10,148 posts
Yep - it's just as easy. Create 2 new directories in your modules img directory - i.e.:

ntYourModule/img/icons_black
ntYourModule/img/icons_white

And place the icons inside the respective directory. They should be 64x64 transparent PNGs - one black, one white (the core will handle coloring them if you choose to use a color). Reset caches and make sure the "Reset Icon Cache" is checked and you're good to go.

I'd recommend naming the icons with the module name - i.e.

ntYourModule_checkmark.png

Then you can use "ntYourModule_checkmark" when making the jrCore_icon call.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
TiG
TiG
@tig
4 years ago
184 posts
Brian

That is what I initially did. Looks like the browser cache messed me up.

Thanks


--
TiG

Tags