About Controlling the Page Hierarchy in Wagtail
In Wagtail, you can programmatically set parameters like max_count
, parent_page_types
, and subpage_types
to control the hierarchy of page navigation that content editors will create, e.g.:
from wagtail.models import Page
class HomePage(Page):
# only one home page allowed per website
max_count = 1
# must be at the root
parent_page_types = ["wagtailcore.Page"]
# subpages can be of these types
subpage_types = [
"standard_pages.StandardPage",
"form_pages.FormPage",
]
Tips and Tricks Programming Development Django 5.2 Django 4.2 Wagtail 7
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.