Tutorial Wagtail Version: 2.x
Wagtail has a really nice and minimalistic WYSIWYG editor called Draftail. The nice thing about it being so minimalistic is the features we don't have to support out of the box. As in, we don't need to support every known HTML element ever written; we just need to support:
But there comes a time when you need more. Maybe you client wants to center text on their website. Well.. you have two options:
I lean towards option #2: let them center their own text. The below code is the final code that you'll see in the git commit and the YouTube video above. For a full understanding of what's going on, definitely watch the video. Or feel free to tinker with the code until it does what you want it to do.
Setting Up A RichText Content Area
In Wagtail you can have two Richtext areas: a model field and a StreamField. In this article we'll cover the model field type.
Setting Up RichText Streamfields
In Wagtail you can have two Richtext areas: a model field and a StreamField. In this article we'll cover the Streamfield type.
How to Add a Basic StreamField to your Wagtail CMS Page
In this lesson we are going to learn how to add a basic StreamField to a a generic Wagtail CMS Page. We'll create a new app from scratch, and this StreamField will have a title and text (using StructBlock), a custom template, and it will lay the foundation for the next lesson which covers inheriting RichTextBlock and modifying the features it can have.