Hi,
I’m overwriting the isListed
function in a page model to implement some custom logic to determine if a page should be visible or not:
class MyPagePage extends Page {
public function isListed(): bool {
$test = // some logic here ...;
return $test;
}
}
This works fine for $page->children()->listed()
queries and is from the end user perspective what I want to achieve. However, if I enter the URL of the now unlisted page by hand, it still gets shown. I’m not sure if this is really a problem, but is there any way to also hide the page from the router via some custom logic in the model?
Thank you,
Georg