Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Extends Wagtail to use the Froala WYSIWYG editor in RichTextFields/RichTextBlocks.

Project Description

Extends Wagtail to use the amazing Froala editor. This Wagtail extension requires Wagtail 1.5.x, as it uses WAGTAILADMIN_RICH_TEXT_EDITORS.

Installation

Run the command pip install wagtailfroala

Add wagtailfroala to your INSTALLED_APPS.

Add wagtailfroala.rich_text.FroalaRichTextArea to WAGTAILADMIN_RICH_TEXT_EDITORS in your settings.

For example, to use Froala for all RichTextField and RichTextBlock instances:

WAGTAILADMIN_RICH_TEXT_EDITORS = {
    'default': {
        'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea',
        'OPTIONS': {
            'key': 'xxxxxxxxxxxx'
         }
    }
}

Or, to use Froala only for defined instances…

WAGTAILADMIN_RICH_TEXT_EDITORS = {
    'default': {
        'WIDGET': 'wagtail.wagtailadmin.rich_text.HalloRichTextArea'
    },
    'froala': {
        'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea',
        'OPTIONS': {
            'key': 'xxxxxxxxxxxx',
            'toolbarButtons': [
                'paragraphFormat', 'fontFamily', 'bold', 'italic',
                'underline', 'formatOL', 'formatUL', 'align',
                'color', '|', 'insertHR', 'insertLink', '|', 'undo', 'redo'
            ]
        }
    },
    'froala_small': {
        'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea',
        'OPTIONS': {
            'key': 'xxxxxxxxxxxx',
            'toolbarButtons': ['fontFamily', 'bold', 'italic', 'underline', 'color', '|', 'insertLink'],
            'editorClass': 'editor-small'
        }
    }
}
html_field = RichTextField(editor='froala')
stream_field = StreamField([
    ('html', RichTextBlock(editor='froala_small'))
])

Options

You will need to ensure that the key option is correctly set with your Froala license key.

By default, Codemirror HTML syntax highlighting is enabled, you can disable it if you wish.

FROALA_CODEMIRROR = False

Font Awesome is required by Froala for toolbar icons, so it is included by default. If you don’t want to include it or already have a version included, you can disable it.

FROALA_FONT_AWESOME = False

To Do

Please feel free to contribute.

Release History

Release History

This version
History Node

0.2.9

History Node

0.2.8

History Node

0.2.7

History Node

0.2.3

History Node

0.2.1

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wagtailfroala-0.2.9.tar.gz (329.3 kB) Copy SHA256 Checksum SHA256 Source Mar 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting