Forum

Thread tagged as: Question, Runway

Runway URL routing

Hi

I am trying to use category filters for a collection.

I have a base page whose url is

/latest-news

I have two categories

News
Speakers

I want to have a drop down filter that will generate a url using the base with the catSlug

/latest-news/news

This works if i create a route with

/latest-news/[slug:catSlug]

But if i do not pass a catslug then Perch is marking this as an invalid route and thus not loading the content.

My question is, how can you handle URL routes with conditional slugs to filter collections by categories?

Vinay Jagessar

Vinay Jagessar 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you say "marking this as an invalid route" - what's happening? What do you see?

Hi

It turns out it was a mistake on the subpage path matching the default route /latest-news which meant it was loading this instead. So the issue is now resolved by defining my paths and routes correctly ! Many thanks!