A Wagtail richdocument content type built with wagtail streamfield.
Project description
This is a wagtail app to be applied on wagtail generic docs. It adds the following streamfield blocks:
doc_byline
body_text
quote
bustout
code_chunk
math_formula
table
media_embed
Dependencies
Quick Start
install from pypy:
pip install wagtail-utphy-richdocument
add “utphy_richdocument” and “wagtail.contrib.table_block” to your INSTALLED_APPS setting:
INSTALLED_APPS = [ ... 'wagtail.contrib.table_block', 'utphy_richdocument', ]
In your own app create a new model which subclasses the StreamFieldDoc model.
models.py:
from utphy_richdocument.models import StreamFieldDoc from wagtail.wagtailadmin.edit_handlers import StreamFieldPanel class YourModel(StreamFieldDoc): template = 'path_to_your_template.html' content_panels = Page.content_panels + [ # your_model_fields StreamFieldPanel('body'), ]
In your template, make sure you have the following snippet:
path_to_your_template.py:
{% for block in self.body %} {{block}} {% endfor %}
Finally run:
python manage.py collectstatic python manage.py makemigrations python manage.py migrate
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-utphy-richdocument-0.7.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 672ad527deb0e99159d00ddabf4c9ba189dc005ebe010509cbfc1050fcaff73e |
|
MD5 | d4a5985adbc2783fc5f929cc3252d033 |
|
BLAKE2b-256 | acc87d5f9adedc68ec811945e3e9c32b541a803a9028fbe7d3f91d76447fa0d1 |
Close
Hashes for wagtail_utphy_richdocument-0.7.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62a09a6c49b727e4054538c52b4f76a0ecc05b1f9d35ce4e8baa7028451849ad |
|
MD5 | a571b7a6b86dcf8206181ea3ffa5c4f9 |
|
BLAKE2b-256 | f87fe0ddf7e3ce9deadb6387c3d9a25f20c7528ff26c0d06396101249db80bd4 |