2017 © Pedro Peláez
 

silverstripe-module silverstripe-iconfont-picker

generic icon font picker based on peavers/silverstripe-font-awesome

image

anselmdk/silverstripe-iconfont-picker

generic icon font picker based on peavers/silverstripe-font-awesome

  • Monday, July 18, 2016
  • by anselmdk
  • Repository
  • 0 Watchers
  • 1 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 7 Versions
  • 23 % Grown

The README.md

THIS IS A FORK OF peavers/silverstripe-font-awesome

...adjusted to work with any icon font., (*1)

Configuration example

$iconPickerField = IconFontPickerField::create('CustomIconClass', 'Icon');
$iconPickerField->setCustomFontURI('mysite/thirdparty/icofont-custom/css/icofont.css');
$iconPickerField->setCustomFontBaseClass('icofont');
$iconPickerField->setAvailableIcons($this->config()->available_icons);
$iconPickerField->setUseFontAwesome(false);

Initial Readme

Synopsis

Provides a field to easily pick font-awesome icons, (*2)

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., (*3)

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

Screen shots

Font awesome icon view

Font awesome icon

Filter view

Filter, (*5)

Usage

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

    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, (*7)

    <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., (*8)

Want colours instead of icons?

Got you covered, checkout color-swabs!, (*9)

Libraries used/modified

  • Font Awesome Icon Picker 4.5

The Versions

18/07 2016

dev-master

9999999-dev

generic icon font picker based on peavers/silverstripe-font-awesome

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

font-awesome

05/08 2015

v1.1.2

1.1.2.0

A simple form field for selecting font-awesome classes in the CMS.

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

font-awesome

28/07 2015

v1.1.1

1.1.1.0

A simple form field for selecting font-awesome classes in the CMS.

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

font-awesome

28/07 2015

v1.1.0

1.1.0.0

A simple form field for selecting font-awesome classes in the CMS.

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

font-awesome

12/06 2015

v1.0.5

1.0.5.0 https://github.com/peavers/silverstripe-font-awesome.git

A simple form field for selecting font-awesome classes in the CMS.

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

silverstripe icons font-awesome

10/05 2015

v1.0.4

1.0.4.0

A simple form field for selecting font-awesome classes in the CMS.

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

font-awesome

10/05 2015

v1.0.3

1.0.3.0

A simple form field for selecting font-awesome classes in the CMS.

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Turner

font-awesome