Tutorial Wagtail Version: 2.x
Let's take a look at how we can filter blog posts by their URL. Previously we made a Blog Listing Page with the URL of /blog/. In this tutorial we'll add /blog/category/{category_name}/ and filter pages based on the slug in the URL.
This is a continuation post from the original Routable Page Mixin tutorial. This time we'll add URL parameters and filter pages based on a custom route.
Below is the code you can use. Please note, it's purposely not complete. I didn't handle missing categories in the try/except block — that's for you to use as needed and replace with what your application needs.
Want to see the entire git commit? No problem! https://github.com/CodingForEverybody/learn-wagtail/commit/1e21b345cd4f8cdfbc1a3fdd9bb53234aaacb820
Routable Pages
Posted on
Routable Pages allow us to create "subpages" under any regular Wagtail Page. Essentially, we can create pages with urls that aren't accessible through the Wagtail CMS admin. We'll learn how to implement routable pages, how to add additional context to the new page, how to render a new page template, how to reverse the routable page url in the template and how to reverse the routable page url in the Wagtail model.
How to Add a Blog Listing Page, Blog Detail Page, and Custom Context
Posted on
In this (long) lesson we're going to cover three main topics. They all go hand-in-hand with Wagtail CMS so it makes sense to learn them all together. The three topics are: Listing Pages, Detail Pages and Adding Custom Context to your pages.
Getting Child Page Properties From a Subclassed Page
Posted on
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.
Adding, Modifying and Removing Sitemap Entries
Posted on
In this video we are going to learn how to install Wagtail Sitemaps (sitemap.xml) and how to add, remove and modify sitemap data in a Wagtail Page.
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.