Get Started

Configuration

You can customise Icon Picker’s settings using a PHP configuration file. This is optional: each setting has a default, so you only need to include the values you want to change.

To override a setting, create icon-picker.php in your Craft project’s /config directory and return an array of setting names and values. For example, the following will set the icon item wrapper size to 64 pixels:

<?php

return [
    'iconItemWrapperSize' => 64,
];

All other settings keep their defaults. Add any further settings you want to change to the same array. The options below explain the available settings and their defaults. You can also manage many of these settings in the control panel under Settings → Icon Picker.

Configuration Options

enableCache

Whether to cache icons. This should only be set to false for testing purposes, as this can be resource-intensive.

iconSetsPath

File system path to the base folder for your icons. The default is an icon-picker folder in your web root directory. This also accepts environment variables or aliases.

iconSetsUrl

The base URL prepended to the path and filename of the icon. The default is an icon-picker folder in your web root. This also accepts environment variables or aliases.

redactorFieldHandle

To enable Icon Picker for use with Redactor, supply the field handle for an Icon Picker field.

The field’s Default icon size uses the following dimensions. Small and Large scale the artwork and adjust the selectable area, keeping space for below-icon labels.

iconItemWrapperSize

The number (in pixels) for the width and height of the icon wrapper when shown in the icon-selector dropdown. This represents the selectable square for the icon.

iconItemWrapperSizeLarge

The number (in pixels) for the width and height of the icon wrapper when shown in the icon-selector dropdown, when Labels is set to Below Icon in the field settings. This represents the selectable square for the icon.

iconItemSize

The number (in pixels) for the width and height of the inner icon when shown in the icon-selector dropdown. This represents the actual icon glyph within the wrapper.

iconItemSizeLarge

The number (in pixels) for the width and height of the inner icon when shown in the icon-selector dropdown, when Labels is set to Below Icon in the field settings. This represents the actual icon glyph within the wrapper.