How does routing effect isOpen?

I have some routing that returns data displayed on a template in a sub folder.
Specifically my site has a home folder and blog folder and a blog/archive folder.
The routing is processed on the blog archive from a request like example.com/2015
I just noticed that on my site menu system the css class is highlighting the Home menu button instead of the Blog menu button. So $page->isOpen() is true on the home directory and not on the blog directory when the request is handled by custom routing. Is there any way to have the custom route change how isOpen is handled for the request?

Or does $page->isOpen() always return true on the home directory when a route is used, regardless of where the action page for the route is located?

So, $page->isOpen() uses $site->page() to check whether the current page matches. If that isn’t set then the default return value is the home page.

You can set $site->page by calling site()->visit($uri) in your route. I think. This is purely from reading the source code.

2 Likes

That’s exactly what I needed!
I just put that in my route and isOpen() is now returning true on the $uri variable that I configured for this particular route.
Thanks for the help.