A simple form field for selecting font-awesome classes in the CMS.
Go to file
2015-12-18 08:40:56 +13:00
_config Greatly simplified this module, removed a number of unnecessary features. 2015-07-28 10:50:19 +12:00
code Greatly simplified this module, removed a number of unnecessary features. 2015-07-28 10:50:19 +12:00
css * Updated to use fontawesome v4.4.0 2015-08-05 15:12:20 +12:00
fonts * Updated to use fontawesome v4.4.0 2015-08-05 15:12:20 +12:00
images/screens Greatly simplified this module, removed a number of unnecessary features. 2015-07-28 10:50:19 +12:00
js * Updated to use fontawesome v4.4.0 2015-08-05 15:12:20 +12:00
_config.php Greatly simplified this module, removed a number of unnecessary features. 2015-07-28 10:50:19 +12:00
.editorconfig Added standard .editorconfig file 2015-12-18 08:40:56 +13:00
.gitignore Initial commit. 2015-05-09 12:31:32 +12:00
composer.json Renamed; 2015-06-08 13:09:48 +12:00
readme.md Formatting; 2015-07-28 15:20:45 +12:00

Synopsis

Provides a field to easily pick font-awesome icons

Features

  • Easily pick icons to be used anywhere in the frontend
  • Can filter on icon name

Installation

Composer

Make sure you're not double loading the css/fonts with a theme.

Ideally composer will be used to install this module. composer require "moe/font-awesome:@stable"

Screen shots

Font awesome icon view

Font awesome icon

Filter view

Filter

Usage

A basic working example, and the following to any class you want the field on;

    private static $db = array(
        'Icon' => 'Varchar(255)',
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $fields->addFieldsToTab('Root.Main', array(
           FontAwesomeField::create("Icon", "Font Awesome icon")
        ));

        return $fields;
    }

Then simple include in the template where you want the icon placed

    <i class="fa $Icon"></i>  

The controller extension should make sure you've got access to the icons so you don't need to double up the CSS file.

Want colours instead of icons?

Got you covered, checkout color-swabs!

Libraries used/modified

  • Font Awesome Icon Picker