Giter Site home page Giter Site logo

silverstripe-fontawesome's Introduction

Silverstripe Font Awesome Icon Picker

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>

silverstripe-fontawesome's People

Contributors

hailwood avatar

Stargazers

Christopher Staley avatar  avatar

Watchers

 avatar

silverstripe-fontawesome's Issues

Add a shortcode for icons in html Editor field.

It should convert [fa icon='star' classes='some extra classes'] into <i class="fa fa-star some extra classes"></i>)

Any attributes other than icon or classes should be passed along as is e.g. [fa icon="star" classes="another" title="A star"] would be <i class="fa fa-star another" title="A star"></i>

It should be optional (a register_shortcode option in the yml probably enabled by default)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.