This Django app provides an inline image block for the Draftail WYSIWYG editor.
You can play with this plugin on a demo site here.
This image block supports:
- upload
- search
- resize
- captions
- hyperlinks
This is what the image block looks like in the Draftail WYSIWYG editor:
Clicking on the block reveals a modal, which allows you to edit the image:
In settings.py
you need to register the app in INSTALLED_APPS
# settings.py
INSTALLED_APPS = [
# ...
'wagtailnewsimage',
# ...
]
In urls.py
you need to add wagtailnewsimage.urls
. The base url (wagtailnewsimage/
) can be configured to be whatever you like.
# urls.py
urlpatterns = [
# ...
path(r'wagtailnewsimage/', include('wagtailnewsimage.urls')),
# ...
]
In models.py
you need to add news-image
to your RichTextField features whitelist
# models.py
class MyPage(Page):
body = RichTextField(features=[
# ...
'news-image',
# ...
])
- Wagtail (2+)
- Django (1.11+)
- Django Rest Framework (3+)