Prevent users from creating 'index' pages?
See original GitHub issueApologies if this has already been answered, but I couldn’t find any related issue.
While working through the Wagtail tutorial, we create a BlogIndexPage
, and subsequently Blog posts. Once the Blog index is created, there is no need to create another BlogIndexPage
. How can I restrict users from creating secondary index pages? E.g. is it possible to keep the BlogIndexPage
from showing up as an option when creating a new page?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Prevent users creating constraints or indexes with no name
The simplest way to do this (though it makes me shudder a bit) is to use a database level DDL trigger with EVENTDATA....
Read more >How To Prevent Users From Creating Certain Page Types in ...
How To Prevent Users From Creating Certain Page Types in Wagtail CMS ; from wagtail.core.models import Page ; class BlogIndexPage(Page): ; = os....
Read more >How to Prevent Google from Indexing Certain Web Pages
The most effective and easiest tool for preventing Google from indexing certain web pages is the “noindex” metatag. Basically, it's a directive ...
Read more >Block Search Indexing with 'noindex' - Google Developers
A noindex tag can block Google from indexing a page so that it won't appear in Search results. Learn how to implement noindex...
Read more >Prevent content from appearing in search results
Learn about the different methods you can use keep search engines from indexing specific content on your website.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You could also try something like this
The ‘unofficial way’, as covered by tests is to override
can_create_at
and augment the parent check with anot cls.objects.exists()
https://github.com/wagtail/wagtail/blob/master/wagtail/tests/testapp/models.py#L862
Will work on adding
max_count
and updating the documentation to settle on one solution.