dljoseph / silverstripe-fontawesome-iconpickerfield

Font Awesome Icon Picker Field for SilverStripe 3.x based on http://mjolnic.com/fontawesome-iconpicker
BSD 2-Clause "Simplified" License
13 stars 9 forks source link

SilverStripe Font Awesome Icon Picker Field

Font Awesome Icon Picker for SilverStripe 3.x based on http://mjolnic.com/fontawesome-iconpicker

SilverStripe Font Awesome Icon Picker Field

Maintainer Contacts

Requirements

Installation Instructions

Installation can be done either by composer or by manually downloading a release.

Via composer (best practice)

composer require "thisisbd/silverstripe-fontawesome-iconpickerfield:*"

Manually

  1. Download the module from the releases page.
  2. Extract the file (if you are on windows try 7-zip for extracting tar.gz files
  3. Make sure the folder after being extracted is named 'fontawesome-iconpickerfield'
  4. Place this directory in your sites root directory. This is the one with framework and cms in it.
  5. Visit <yoursite.com>/?flush to clear the manifest cache.

Usage Overview

private static $db = array(
    'FontAwesomeIcon' => 'Varchar'
);

In getCMSFields do this or something similar:

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

    $fields->addFieldToTab(
        'Root.Main',
        FontAwesomeIconPickerField::create('FontAwesomeIcon', 'Font Awesome Icon')
    );

    return $fields;
}

Frontend implementation

Suggested is to always use the latest version of FontAwesome, as the module tries to get all the available icons from the FontAwesome YML file on Github.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css"/>

Known Issues

No known issues.