Tutorial Wagtail Version: 2.x
Wagtails RichText editor, Draftail, is very minimal out of the box. There are times when you need to extend it's functionality. Luckily for backend developers, we can extend the Draftail editor by writing a Wagtail Hook in Python. No JavaScript needed! We're create an inline <code> and a centered text feature in this tutorial.
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
Posted on
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
Posted on
In Wagtail you can have two Richtext areas: a model field and a StreamField. In this article we'll cover the Streamfield type.
Headless CMS: Serializing RichText Blocks
Posted on
Wagtail stores RichText (WYSIWYG) data as HTML-like code, but it's not perfect HTML. In this video we'll explore how to serialize Wagtail's RichText data into proper HTML.
How to Add a RichText StreamField to your Wagtail CMS Page
Posted on
In this video we are going to learn how to create a RichTextBlock StreamField, and then we're going to duplicate that StreamField and limit the number of features the editor gives us.
This course covers everything from basic installation to advanced features like custom blocks and API integration, it's perfect for developers looking to enhance their skills with this powerful CMS.