hailwood/silverstripe-fontawesome

This package is abandoned and no longer maintained. No replacement package was suggested.

Adds a new iconpicker fieldtype.

Installs: 25

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 2

Open Issues: 2

Type:silverstripe-module

1.0.0 2017-01-09 08:23 UTC

This package is not auto-updated.

Last update: 2020-01-24 16:47:11 UTC


README

A Silverstripe Font Awesome Icon Picker:

Screenshot

  • Always up to date: We read the yaml from the font awesome repository. Just specify your version and you're read to go.
  • Optional on the frontend: We know on the frontend you might like to bundle your own font awesome icons, so you choose if you want us to load them from the CDN.

Options

FontAwesomeIconField:
  version: 4.6.3
  autoload_css: true

Usage

Dataobject/Page
class PageWithIcon extends Page {

    protected static $db = [
        'PageIcon' => 'FontAwesomeIcon',
    ];
    
    public function getCMSFields(){
        $fields = parent::getCMSFields();
        
        $fields->addFieldToTab('Root.Main', FontAwesomeIconField::create('PageIcon', 'Icon'));
        
        return $fields;
    }

} 
SS Template (if you have other classes to add)
<div>
<strong>Page Icon:</strong> <i class="{$PageIcon.Classes} some-other-class"></i>
</div>
SS Template (if you don't want to customize it)
<div>
<strong>Page Icon:</strong> {$PageIcon}
</div>