1

I want to create children of a page (such as "/questions/example"), without having to create the root page "/questions". Is there a quick way of implementing something like this?

be2213444
  • 607
  • 1
  • 4
  • 10

1 Answers1

0

Child pages need to be, well, children - so there's no easy way to get around this.

However, if what you're asking is "I want to have /questions/foo/ without having to have a page accessible at /questions/", two options are:

  1. add a new QuestionsPage to your project, add it as a child of the root, save as a draft and don't publish it - you'll then be able to add child pages to it and publish those, but anyone going to /questions/ will get a 404. This 'works' but isn't super-nice

  2. add a StructuralPage (or similar naming) to your project, and override the serve() and serve_preview() methods to redirect to the homepage (or somewhere else) if someone accesses them. You can add child pages to that, etc, as above.

Steve Jalim
  • 11,989
  • 1
  • 37
  • 54