Group different blueprint childrens with slugs

I have a page with children, but three different ones. Let’s say:

Page
  Parts
  Vehicles
  Projects

Currently, the structure of the URLs is:

page/part-1
page/part-2
page/part-3
page/vehicle-1
page/vehicle-2
page/vehicle-3
page/project-1
page/project-2
page/project-3

Is there any way, maybe with router or similar, to achive something like this:

page/parts/part-1
page/parts/part-2
page/parts/part-3
page/vehicles/vehicle-1
page/vehicles/vehicle-2
page/vehicles/vehicle-3
page/projects/project-1
page/projects/project-2
page/projects/project-3

So your parts, vehicles and projects are not parent folders for the vehicle-1 etc. pages, right?

Question: Why don’t you put them into /parts, vehicles, and projectssubfolders?

And yes, you could achieve this with routes without putting them into subfolders.

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?

Something like this:

    '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.