This project is read-only.

Creating new non-admin page route

Topics: Writing modules
Oct 17, 2013 at 3:58 PM
In a custom module I'm trying to create a new page (route). It's best explained if I use the Blogs module as an example. I'm not proposing changing the blog module, I'm just using it as an example...

Say I have a blog created at /blog ... I'd like to also have a /blog/archive where "archive" is not something the user can configure... it's just a stock thing you get with the blog module. With the routes I've been creating for the admin, I'm using the ID field but what I really want to use is the route so my route is something like "/[blog route]/archive" ... then not sure how to build the view for this guy.

ideas / pointers?
Oct 17, 2013 at 8:03 PM
I think you'll have to use a route constraint. There's a couple of examples of that in the code.