micc83 / fontIconPicker

🌈 jQuery fontIconPicker v2 is a small (3.22kb gzipped) jQuery plugin which allows you to include a simple icon picker with search and pagination inside your administration forms.
http://micc83.github.io/fontIconPicker/
MIT License
266 stars 87 forks source link

stupid question - only using fontawesome #17

Closed WPThemer closed 8 years ago

WPThemer commented 9 years ago

Hi..

Thanks foe this amazing plugin, I am going to use it in one of my wordpress theme. However, I am a bit confused, I only want to use FontAwesome, is there any example which displays categorized fontawesome icons only ?

regards

micc83 commented 9 years ago

Hello WPThemer. Unfortunately Fontawesome icons doesn't come with categories. The easiest way i can think of is to download Fontawesome from Fontello and customise the provided config file adding a category field to each icon then using that file to build a source Object to be passed to fontIconPicker.

// Build an object like this from the Fontello config file
var sourceIcons = {
    'Category 1' : ['icon-heart', 'icon-lemon'],
    'Category 2' : ['icon-user', 'icon-tag', 'icon-help']
}

// Then pass it to 
$('.input').fontIconPicker({
    source: sourceIcons,
    emptyIcon: false,
    hasSearch: false
});
WPThemer commented 9 years ago

Hi micc..

thanks for the reply.. Sorry for my ignorance, but is Fontello the same Library (Font Awesome) ? secondly in my code I have the Font Awesome Codes like fa-gears instead of icon-gears, is there anything I need to change in CSS files...

regards

micc83 commented 9 years ago

Fontello is an icon fonts bundle generator http://fontello.com/

If you'll go for fontello no problem as all the icons name will be changed to icon-* otherwise i guess you can use the "fa fa-*" syntax on the sourceIcons Object.

WPThemer commented 9 years ago

ok Thanks.. I will try and get back here...

thanks once again... cheers