Skip to main content

Extends Wagtail to use the Froala WYSIWYG editor in RichTextField/RichTextBlock.

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']
};

To Do

  • [ ] Incoorperate page chooser for links (like hallo.js).

  • [ ] Incoorperate document chooser for links (like hallo.js).

  • [ ] Incoorperate image chooser (like hallo.js).

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.tar.gz (325.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for wagtailfroala-0.2.tar.gz
Algorithm Hash digest
SHA256 57692eb5e0d2d39916772d691c4e7e7001b3d3f941fdf359d2f2f26e12b4a5c3
MD5 6a6a283d7c06c838aa9b60ec4259269d
BLAKE2b-256 273fdc0d1745ecf5fa1371787a82da679be8703beae87226f934eeee107ad441

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