Whenever you're dealing with an icon in your template, you're actually working with a Icon
object.
Attribute | Description |
id | ID of the icon. |
icon | The filename and relative path of the icon. |
sprite | The filename and relative path of the icon. Set only if using SVG Sprites. |
glyphId | Set only if using an Icon Font. |
glyphName | Set only if using an Icon Font. |
css | Set only if using an Remote Icon. |
iconSet | The icon set this icon belongs to. |
type | What type of icon this is: svg , sprite , glyph or css . |
width | The width of the icon. |
height | The height of the icon. |
length | Return the string length of the icon for the field. |
isEmpty | Returns whether or not there's an icon selected for this field. |
Method | Description |
getDimensions(height) | Returns an array of [width, height] for the icon. Pass in an optional height to restrict it by, while keeping the aspect ratio of the icon. |
getUrl() | Return the full URL to the icon. |
getPath() | Return the full path to the icon. |
getInline() | Returns the raw contents of the icon. |
getIconName() | Returns the name of the icon, without the extension. |
getGlyph(format) | Returns the character representation of an individual icon glyph, for when an icon font is used. |
Format | Example |
getGlyph('decimal') | Get the icon unicode (decimal). |
getGlyph('hex') | Get the icon unicode (hexadecimal). |
getGlyph('char') | Display the icon as html character - � . |
getGlyph('charHex') | Display the icon as html character hex -  . Default |