Tutorial Wagtail Version: 2.x
The Wagtail docs can't possibly cover everything, that's pretty unrealistic to expect perfect documentation. So in this video I will show you how to explore StreamField options that aren't always available in the documentation. You can apply what you'll learn in this video to any feature in Python, but we're using StreamFields as an example. Let's learn how to dive into a core feature of Wagtail!
For simple StreamFields you do not need to create custom classes. If you want to, that's 100% OK to do. Below you will see an example of a CharBlock
that uses most of the available CharBlock
kwargs.
If you're wondering how I know we can use these fields:
required
help_text
min_length
max_length
template
Well the TL;DR version is: I went to the source code https://github.com/wagtail/wagtail/blob/master/wagtail/core/blocks/field_block.py#L97
If you want to know how I found this, you'll need to watch the video and about half way through I start talking about how to find the source code by working backwards from my current code.
Take a look at all the code I wrote in this tutorial: https://github.com/CodingForEverybody/learn-wagtail/commit/261adec1f07a4fe74f53610b69418b5f52484240
StreamField Deep Dive 2: Exploring Common StreamFields
Posted on
We'll dive into most of the simple StreamFields and explore some of the options they have to offer. We'll also look at ChooserBlock inheritance for the PageChooserBlock, ImageChooserBlock and DocumentChooserBlock.
How to Use ListBlocks to Create Repeating StreamField Content
Posted on
Occasionally you'll want a StreamField that can have multiple repeating content areas. A good example is the design component known as a Card. In this lesson we'll explore a ListBlock to enable us to create unlimited cards with custom data, ImageChooserBlock, PageChooserBlock and how to loop through a ListBlock in your Wagtail CMS template.
How to Add a Basic StreamField to your Wagtail CMS Page
Posted on
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.
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.