Skip to content

Latest commit

 

History

History
53 lines (31 loc) · 1.07 KB

README.rst

File metadata and controls

53 lines (31 loc) · 1.07 KB

A convenience package for adding IcoMoon icons to the Wagtail admin. At the moment only includes the general purpose icons, but could be extended.

Installation

pip install wagtail-icomoon

Then add the following to your settings.py:

INSTALLED_APPS = (
    ...
    'wagtail_icomoon',
    ...
)

Usage

Icons are prefixed with im- to avoid clashes with existing icons.

e.g. for a streamfield block

from wagtail.core import blocks

class DemoBlock(blocks.CharBlock):
    class Meta:
        icon = 'im-camera'


# or as part of the initialisation of a StreamField
body = StreamField([
    ('demo', blocks.CharBlock(icon='im-star')),
])

In a template

{% load wagtailadmin_tags %}
{% icon name="im-wrench" classname="..." title="Fix" %}

For a complete list of icons, see the IcoMoon website, or check the templates/icons directory of this project.