I am in the process of migrating an existing Django app for a news website over to Wagtail.
The first part of this migration will be porting all of the existing articles, that exist as Django models, over to Wagtail Pages.
Along with this, we will have separate Wagtail Page types for website pages such as terms and conditions, privacy policy, etc.
My question is the following, when looking that the Wagtail admin, it is clear that the articles need to be nested beneath a parent page for organizational purposes, otherwise all of the article pages will live amongst unrelated pages such as terms and conditions, privacy policy, etc...
I have thus created a basic Page which is used only for organizational purposes, it is the parent for all Articles and lives at the HomePage level.
class ArticleListing(Page):
"""A page meant for organizational purposes. All articles live under this page."""
max_count = 1
parent_page_types = ['news.HomePage']
subpage_types = ['news.Article']
The problem is that in order to register this page, it is given a url path. I do not want to return anything from this page at all, the url related to it should throw a 404. What should I do here? I am thinking about overriding the route method to return a 404.
Is this a perversion of the Wagtail framework? If so how exactly am I supposed to organize my content within the Wagtail admin without having a giant mix of unrelated pages with no organization?
This same problem thus applies to the HomePage model I am using, which again is purely for organizational purposes at this stage in the migration.
class Index(Page):
max_count = 1
We created a page type we called "MenuOnlyPage" so that people could add sections to their site without having to have content for the section index page. I don't love it but it is pretty popular.