Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wagtail: how to change the default root and/or home page

Tags:

wagtail

How do I create my custom home page at the root level for my site?

I'm integrating wagtail to my django project. As documented I try to plug my custom homepage model and create a new site record

... You’ll probably want to replace this with your own HomePage class - when you do so, ensure that you set up a site record (under Settings / Sites in the Wagtail admin) to point to the new homepage.

When I try to update my site's root settings, page explorer doesn't list my custom home page. And I'm unable to create a page from my model at the root level. When I delete the existing root page, then I'm totally stuck.

Any guidance will be appreciated. Thanks.

Update (resolved)

Thinking that my custom home page will be the root of my side, I had this setting parent_page_types = [] in my model. Removing it lets me add it as child to existing root, which I can point in my site as the root.

like image 202
Tiny Instance Avatar asked Nov 29 '17 09:11

Tiny Instance


1 Answers

Note: This was answered in the question via an update, pasting below for future readers.

On the page model, setting parent_page_types = [] meant that this page could not be put under other pages. As the root page is also a page, it meant the home page could not be set correctly.

Removing it lets you it as child to existing root, which I can point in my site as the root.

Docs - Page.parent_page_types

like image 75
LB Ben Johnston Avatar answered Sep 19 '22 14:09

LB Ben Johnston