Skip to main content

Add FontAwesome icons to StreamField.

Project description

Add FontAwesome icons to StreamField.

Screenshot

Install

pip install wagtailfontawesome

Then add wagtailfontawesome to your installed apps.

Usage

StreamField

Add FontAwesome icons to StreamField the regular way, just set icon=”fa-something”. Reference the full list.

wagtailmodeladmin

wagtailmodeladmin is supported if you’re using Wagtail 1.4 or above. Similar to StreamField, just set icon=”fa-something” on your menu item.

Hallo plugins

You can use FontAwesome icons on custom Hallo buttons by setting the icon option to icon icon-fa-something.

button.hallobutton({
  label: "Blockquote",
  icon: 'icon icon-fa-quote-left',
});

Other parts of the admin

You can include icons anywhere in the admin with:

<i class="icon icon-fa-something"></i>

In Wagtail 1.3.x and below you can only use icons on the page editor screen.

On the front-end

You can also import this on the front-end, if you want.

{% load staticfiles %}

<link rel="stylesheet" href="{% static 'wagtailfontawesome/css/wagtailfontawesome.css' %}">

Then include icons anywhere on the front-end with:

<i class="icon icon-fa-something"></i>

Using wagtailfontawesome as an optional dependency

If you want to distribute a Wagtail plugin with FontAwesome icons, you can use this package as an optional dependency by checking if it’s installed in Django, and falling back otherwise.

from django.apps import apps
from wagtail.wagtailcore.blocks import StructBlock


class BlockquoteBlock(StructBlock):
    quote = TextBlock()
    author = TextBlock()

    class Meta:
        if apps.is_installed('wagtailfontawesome'):
            icon = 'fa-quote-left'

(in this case, the fallback is to do nothing)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtailfontawesome-1.0.7.tar.gz (638.8 kB view details)

Uploaded Source

Built Distribution

wagtailfontawesome-1.0.7-py2.py3-none-any.whl (639.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file wagtailfontawesome-1.0.7.tar.gz.

File metadata

File hashes

Hashes for wagtailfontawesome-1.0.7.tar.gz
Algorithm Hash digest
SHA256 3c0bd8ca3f8932f47e7f3ec812617ef66406333c154bbe806f86edf4bcf7ea1a
MD5 268dd99926220e83f1e253ddc28685cc
BLAKE2b-256 65183d579c25714ac29d2c9acfbd16ac59deeee44f5a45c559959ba7b4c6511e

See more details on using hashes here.

File details

Details for the file wagtailfontawesome-1.0.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for wagtailfontawesome-1.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3f752f10459ca653b20533004c4022cad74bd3cde3d3fad39a5b666b77d20843
MD5 b673c75516a65860df18d126bc60263c
BLAKE2b-256 ee1ff9f83a772fd3adfcd360cc6685987e7481ccf7b421097f00a1693a0c6dc2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page