Yes, parts, vehicles and projects does not really exist … can’t put them into real subfolders as this will kill the whole backend and this is already existing. Also, I find it very confusing for the customer. He only have one page where all of these 3 are in the blueprint. I would only have this for structure and seo reasons.
Sorry to annoy you, but have you a example how such a route can look like, based on template or blueprint?
'routes' => [
[
'pattern' => 'page/(:any)/(:any)',
'action' => function ($cat, $uid) {
// we use a single placeholder but we want to make sure
// that only one of the three categories returns a page
$categories = ['vehicles', 'projects', 'parts'];
if(in_array($cat, $categories)) {
if (($page = page('page/' . $uid)) && $page->intendedTemplate()->name() === $cat) {
return page('page/'. $uid);
}
}
$this->next();
}
]
],
I’m assuming that the template used by the children is the same as the slug name for this example to make sure that only a page corresponding to the category is returned. Adapt as needed.