Is it possible to have multiple routes going to one page for example:
/products/:cat/:cat_name?/
This would filter the DB on ‘cat’
but then I would also like to do this on the same page
/products/:cat/:cat_name?/:subcat/
Which would filter the DB on ‘cat’ and ‘subcat’ on the same page.
Is this possible or is there a better way of doing this ?
I would do search parameters in the querystring and not in the url path. Routing is good for dynamic detail pages and for SEO. Passing optional parameters like for a search or filter I would just put in the querystring.
Which is working fine for one query, however if I put another in there then it does not work.
for example on Button 1 there would be a ‘cat’ on button 2 there would be a ‘cat’ & ‘subcat’ this is what I need to do.
@Hyperbytes Hey Brian, I ended up doing it a slightly different way than I was originally planning.
I’ve got the router working finally.
However rather than doing a query I’ve just set it to a select menu I have in there for Subcat, which is better as you can also then just click to alter the result for other things.
I’ll add a slug into it as well for SEO purpose.