Skip to content

StocksDigital/wagtail-news-image

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Wagtail News Image

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:

Wagtail WYSIWYG view

Clicking on the block reveals a modal, which allows you to edit the image:

Wagtail editor modal

Installation

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',
        # ...
    ])

Dependencies

  • Wagtail (2+)
  • Django (1.11+)
  • Django Rest Framework (3+)

About

Extended image block for the Draftail WYSIWYG editor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published