2017 © Pedro Peláez
 

silverstripe-vendormodule iconfield

Icon field for SilverStripe

image

jaedb/iconfield

Icon field for SilverStripe

  • Wednesday, June 13, 2018
  • by jaedb
  • Repository
  • 0 Watchers
  • 0 Stars
  • 459 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 83 % Grown

The README.md

Description

Simplifies the use of icons in a way content authors can set icons without interfering with the asset library. Instead, the web developer provides the icon set which the end-user can use but not manipulate., (*1)

IconField, (*2)

Requirements

  • SilverStripe 4

Usage

  • Import the required classes:
use Jaedb\IconField\Icon;
use Jaedb\IconField\IconField;
  • Set your $db field to type Icon (eg 'PageIcon' => Icon::class)
  • IconField::create($name, $title, $iconFolder)
  • $name is the database field as defined in your class
  • $title is the label for this field
  • $iconFolder (optional) defines the directory where your icons can be found. Defaults to /site/icons.
  • To change your default icon directory, see _config/config.yml.
  • Use your icon in templates as you would any other property (eg $PageIcon). If your icon is an SVG, the SVG image data will be injected into the template. To prevent this, you can call $PageIcon.IMG instead to enforce use of <img> tags.

The Versions

13/06 2018

dev-master

9999999-dev http://jamesbarnsley.co.nz

Icon field for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe

22/02 2018
22/02 2018