Let's say I've created a blog for my website. The tree structure setup in the Wagtail admin looks like this:
Homepage > Blog Index > Blog Post
Is it possible to keep the Blog Index page in the admin page tree but remove it from the URL so that my URL's look like this:
Homepage > Blog Post
I am assigning a custom group to the Blog Index page which allows them to edit only Blog Posts that they have created, which is why Blog Index needs to stay in the tree on the admin side.
I've done a little work with the routablepagemixin but not to eliminate anything from the URL, only add to it.
I'm not entirely certain if a
RoutablePageMixin
is the right way to go about this, but that's how I've solved this before.Here's an example of how you could do it with a
RoutablePageMixin
and aroute
(Note: I chopped this together pretty quickly and didn't test it, you might need to do some adjusting)One other thing to note: you'll want to change the sitemap url on your original blog post pages so they don't show up as
/blog/blog-slug/
inside ofsitemap.xml
.