23_wagtail_cms_child_parent_specific_pages.png
View Post
Learn Wagtail Course

How to only get Parent and Child Class Pages and their Specific Fields

When querying for a Wagtail Page that has child (Subclassed) pages, you'll receive all of the pages in your QuerySet. There are times when you simply want the child pages (all types), a specific type of child page, or just the parent page itself with no children. In this lesson we'll explore Wagtails .not_exact_type() and .exact_type() methods.

22_wagtail_page_specific_child_pages.png
View Post
Learn Wagtail Course

Getting Child Page Properties From a Subclassed Page

In Wagtail, and just like in Django, you can subclass classes. In this lesson, we're subclassing a Wagtail Page into 2 child pages. But when we query for all the parent classes, we're also given the child classes in the QuerySet, and the data is somewhat inconsistent because child classes can have unique fields that differ from their parents and siblings.

21_subclassing_django_wagtail_pages.png
View Post
Learn Wagtail Course

How to Subclass Wagtail Pages

Subclassing is having a class (in this case it's a Wagtail Page) that can be used for other classes (Wagtail Page's). The parent class has all the common attributes for the child pages, and every child page will inherit everything from it's parent. In this lesson we'll explore that by creating a subclassed Article and Video Blog Page that share a common parent, and then we'll extend the functionality of ...