0

For one of my templates, I need two extra segments.

If I have the following in template routes, the page only loads if there is 1 segment.

/gallery/{alpha_dash}

If I add the following, it fails:

/gallery/{alpha_dash}/{alpha_dash}

The following works for two or one extra segment, but not just /gallery.

/gallery/{a:alpha_dash}/{b:alpha_dash}

Can anyone explain how I can have it work for all segments:

/gallery
/gallery/...
/gallery/.../...

1 Answer 1

0

If you have the segments required? flag in the template manager is set to "no", then your longest route (i.e. /gallery/{alpha_dash}/{alpha_dash}) should work for all your test cases. If it doesn't, try turning the two alpha_dash instances into separate variables - e.g. /gallery/{a:alpha_dash}/{b:alpha_dash}

2
  • Hi Gavin. Segments required is set to 'no'. As I explain in my question, I already tried /gallery/{alpha_dash}/{alpha_dash} and /gallery/{a:alpha_dash}/{b:alpha_dash} with neither working. Am I to understand that this means there is a bug?
    – ccdavies
    Sep 19, 2016 at 18:53
  • Hi ccdavies - you didn't say in your posting that you had tried setting the segments required to 'no'... Based on the documentation here the long form should work docs.expressionengine.com/v2/urls/template_routes.html Sep 20, 2016 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.