Reputation: 45
On click "Add page child" I want to be able to add a page only when I'm on the first level (homepage). The page model doesn't need to be selected.
Upvotes: 0
Views: 58
Reputation: 1434
You can control where can pages be inserted with parent_page_types
and subpage_types
(see documentation)
For example, the following will only allow the ChildPage
to be created underneath the HomePage
.
class ChildPage(Page):
parent_page_type = ['my_app.HomePage']
Upvotes: 2