Skip to main content

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'
    },
}

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'
    },
}
html_field = RichTextField(editor='froala')
stream_field = StreamField([
    ('html', RichTextBlock(editor='froala'))
])

Options

You will need to add FROALA_LICENSE_KEY to your settings:

FROALA_LICENSE_KEY = 'xxxxxxxxxxxxxx'

You can also specify FROALA_OPTIONS, which should be a dict populated with official Froala options (https://www.froala.com/wysiwyg-editor/docs/options):

FROALA_OPTIONS = {
    'toolbarButtonsMD': ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'color'],
    'toolbarButtonsXS': ['bold', 'italic', 'underline']
}

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

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

wagtailfroala-0.2.8.tar.gz (329.1 kB view details)

Uploaded Source

File details

Details for the file wagtailfroala-0.2.8.tar.gz.

File metadata

  • Download URL: wagtailfroala-0.2.8.tar.gz
  • Upload date:
  • Size: 329.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wagtailfroala-0.2.8.tar.gz
Algorithm Hash digest
SHA256 817360015661e5400f99f8eda5a42bed9b5e3cdc95733b3d892733039c4d6200
MD5 ee15cf35833d454a7ccfe5ec60d2b94d
BLAKE2b-256 67867c707e173ecb66a1727573f08af2883009b546d245df9bc5014316555c68

See more details on using hashes here.

Supported by

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