Tiny Instance
Tiny Instance

Reputation: 2671

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

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.

Upvotes: 6

Views: 3465

Answers (1)

LB Ben Johnston
LB Ben Johnston

Reputation: 5196

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

Upvotes: 1

Related Questions