Skip to main content

WYMeditor RichText widget for Mezzanine

Project description

This is WYMeditor adapted as richtext widget for Mezzanine CMS. It includes basic WYMeditor distribution along with custom image button for use with filebrowser-safe.

Installation

To install mezzanine-wymeditor first make sure you meet the requirements.

Now get it from pypi:

pip install mezzanine-wymeditor

Or directly from source if you prefer:

git clone https://github.com/excieve/mezzanine-wymeditor
cd mezzanine-wymeditor
python setup.py install

Once installed, set up RICHTEXT_WIDGET_CLASS in your local_settings.py like this:

RICHTEXT_WIDGET_CLASS = 'mezzanine_wymeditor.widgets.WymeditorWidget'

and add the application to INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'mezzanine_wymeditor',
    ...
)

Additionally you may override WYMeditor initialisation code (to set your own configs for instance):

WYMEDITOR_SETUP_JS = 'path/to/your/setup.js'

If everything goes well default editor will be replaced with WYMeditor everywhere.

Caveats

  1. Pull requests have been submitted to mezzanine and filebrowser-safe to make 3rd party richtext editors in general and WYMeditor in particular work better with them, which means you’ll either have to experiment with unstable unpackaged software or wait until new versions become public. You may also try using mezzanine-wymeditor with stable versions but it’s guaranteed to break in more than one place. Here are specific issues:

    • jQuery plugins (WYMeditor being one of them) break in Mezzanine admin, doesn’t happen with inline editing though (pull request accepted). For now one can probably workaround it by monkey-patching mezzanine.generic.forms.KeywordsWidget and removing jQuery from Media inner class.

    • WYMeditor’s utilities break after media library call (pull request submitted, but not yet accepted)

    • Mezzanine’s default theme (and very likely custom ones too) goes haywire after media library call via inline editing (pull request submitted, but not yet accepted)

  2. Packaged WYMeditor is version 1.0.0b4, which means it’s a beta. While I consider it to be good enough for everyday use, bugs are possible - please submit them to WYMeditor developers. WYMeditor distribution will be updated upon new releases.

  3. There’s a tiny modification to WYMeditor sources to make it detect static URL properly in Mezzanine admin so it’s not completely vanilla. There are no other changes to the original source.

  4. There are currently two image buttons on the toolbar. The default one lets you insert an image from arbitrary URL and modify some attributes of existing images. The custom one (with filebrowser icon, always at the end) opens up the media library and lets you choose an image from there, which is immediately inserted at the cursor position.

  5. You may want to disable (or relax) Mezzanine’s HTML filtering (RICHTEXT_FILTER_LEVEL) as WYMeditor has it’s own but it’s entirely up to you.

  6. There’s currently no convenient “insert video” functionality but one can still embed iframes in raw HTML provided RICHTEXT_FILTER_LEVEL = 2.

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

mezzanine-wymeditor-0.1.tar.gz (253.7 kB view hashes)

Uploaded Source

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