I have three templates, and three routes in my template group as follows:
- courses -- index (landing page) -- filtered (filtered listing) -- details (course details)
And I want to have the following relevant url structure:
/courses/
/courses/type/undergraduate/
/courses/type/undergraduate/course_name/
And I have set the following routes:
template group/template == route
courses/index == nothing in here
courses/filtered == /courses/{filter:alpha_dash}/{filter2:alpha_dash}
courses/details == /courses/{filter:alpha_dash}/{filter2:alpha_dash}/art/
both 'filtered' and 'details' have segments required.
so.....
/courses
gives me courses landing page no probs, I would expect that, reading from the index template as default behaviour.
/courses/type/undergraduate
gives me back the filtered course type filtered to 'type', 'undergraduate' which is read from the filtered template.
/courses/type/undergraduate/art
gives me back course details for art, reading from the details template, as I expect.
But the problem comes when I put this into my route, adding the course name as the trigger to dynamically shift the the details template as I would expect (as opposed to the hard-coded value 'art'):
/courses/{filter:alpha_dash}/{filter2:alpha_dash}/{coursename:alpha_dash}
When I refresh this: /courses/type/undergraduate/art
I get the following error, plus my template reverts back the initial landing template of the index in the group.
A PHP Error was encountered
Severity: Warning Message: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 166 Filename: libraries/Template_router.php Line Number: 56
So am I missing the point of routes, or is there some bug in the machine here?
EE version 2.9.0 is the flavour I am playing with.