Thanks it worked for me.
But if I understand correctly the documentation states that it should also be correct to use page(), http://getkirby.com/docs/advanced/routing:
Returning a page
function() {
return page('some/page');
}
In both instances you’re returning a page. It’s just that in the process of doing so, site->visit also sets site::page to be the page you’re retrieving, which makes isActive work correctly. Otherwise you just return the page.
Could it be, that site()->visit() doesn’t work anymore for this case (kirby version 2.2.x)? In my custom route i only use site()->visit(), and $page->isOpen() or $page->isActive() doesn’t seem to work.
UPDATE: Sorry, for the confusion. It was a misconfiguration on my page. Now it works as described…