Routing based off selected collections

I'm new to Statamic but know Laravel well (in case the suggestion is to use traditional routes). I'm trying to route using multiple collections.

Actual URL I want: /vacuums/dyson/dyson-v8

Each segment is an entry, but in different collections:

  • vacuums is an entry in Pages
  • dyson is an entry in Brands
  • dyson-v8 is an entry in Vacuums

How can I achieve this?

Currently, I have mounted Brands onto the page 'vacuums'. This gives me /vacuums/dyson as expected. It's the next step, where the Vacuum entry needs to be mounted to the selected Brand entry that I can't work out.

The relationship is done in the blueprint. I have an Entry Selector linked to the collection, so when the admin is adding a Vacuum entry they select the Brand from a dropdown.

FYI, the 'Brands' collection handle is 'brands' and the entry selector is 'brand'.

I've tried a few things for the route value in the Vacuums Collection settings:

  • /{brand}/{parent_uri}/{slug}
  • /{brand:slug}/{parent_uri}/{slug}
  • /{brands}/{parent_uri}/{slug}
  • /{brands:slug}/{parent_uri}/{slug}

They all just give me /dyson-v8 (so just the {slug} part).

Any pointers?

>>>>>>> Unanswered <<<<<<<
1 Reply
3 Followers