I'm building a site with loads of complex itineraries. Entries are in a channel for various reasons, but I want to split the data across subpages, with a URL structure like:
/itinerary/name-of-itinerary
/itinerary/name-of-itinerary/dates-prices
/itinerary/name-of-itinerary/gallery
/itinerary/name-of-itinerary/etc...
I want to route everything through my _views/itinerary/index
template, and then just have a bunch of includes (dates-prices, gallery, etc...) in my index, something like:
{% include ( '_views/itinerary/' ~ craft.request.lastSegment ) %}
In my routes.php I've got:
'itinerary\/(?P<slug>[^\/]+)\/([^\/]+)' => '_views/itinerary',
'itinerary\/(?P<slug>[^\/]+)' => '_views/itinerary',
So everything is routing fine to _views/itinerary/index
. Trouble is, I get a 404 for anything other than /itinerary/name-of-itinerary because Craft uses the last segment to resolve the entry, which is exactly what you'd want normally. But if the last segment is 'dates-prices' or 'gallery' I'm screwed.
Have I set this up right? Is there a more efficient and complete way? Any help much appreciated.