An extended Draftail image block for news sites.
Project description
# Wagtail News Image
This [Django](https://www.djangoproject.com/) app provides an inline image block for the Draftail WYSIWYG editor.
You can play with this plugin on a demo site [here](https://github.com/MattSegal/wagtail-news-image-demo).
This image block supports:
- upload
- search
- resize
- captions
- hyperlinks
This is what the image block looks like in the Draftail WYSIWYG editor:
<img src="./screenshots/WYSIWYG.png" alt="Wagtail WYSIWYG view" width="500px"/>
Clicking on the block reveals a modal, which allows you to edit the image:
<img src="./screenshots/modal.png" alt="Wagtail editor modal" width="500px"/>
## Installation
In `settings.py` you need to register the app in `INSTALLED_APPS`
```python
# 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.
```python
# urls.py
urlpatterns = [
# ...
path(r'wagtailnewsimage/', include('wagtailnewsimage.urls')),
# ...
]
```
In `models.py` you need to add `news-image` to your RichTextField features whitelist
```python
# models.py
class MyPage(Page):
body = RichTextField(features=[
# ...
'news-image',
# ...
])
```
## Dependencies
* Wagtail (2+)
* Django (1.11+)
* Django Rest Framework (3+)
This [Django](https://www.djangoproject.com/) app provides an inline image block for the Draftail WYSIWYG editor.
You can play with this plugin on a demo site [here](https://github.com/MattSegal/wagtail-news-image-demo).
This image block supports:
- upload
- search
- resize
- captions
- hyperlinks
This is what the image block looks like in the Draftail WYSIWYG editor:
<img src="./screenshots/WYSIWYG.png" alt="Wagtail WYSIWYG view" width="500px"/>
Clicking on the block reveals a modal, which allows you to edit the image:
<img src="./screenshots/modal.png" alt="Wagtail editor modal" width="500px"/>
## Installation
In `settings.py` you need to register the app in `INSTALLED_APPS`
```python
# 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.
```python
# urls.py
urlpatterns = [
# ...
path(r'wagtailnewsimage/', include('wagtailnewsimage.urls')),
# ...
]
```
In `models.py` you need to add `news-image` to your RichTextField features whitelist
```python
# models.py
class MyPage(Page):
body = RichTextField(features=[
# ...
'news-image',
# ...
])
```
## Dependencies
* Wagtail (2+)
* Django (1.11+)
* Django Rest Framework (3+)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for wagtail_news_image-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e10ef1c1630ef35ce203ebf12772fbf1722a3892b7d6b6535419f8a0d24c396 |
|
MD5 | 2feb920c5f9cebf3c14722bb101aa784 |
|
BLAKE2b-256 | b9bea07c299d76b7b0184992c97e1a0654074562c8964b3dbec998a6771e5933 |