Page to load all catagory requests from hierachical category tree in the url

Let me explain what I am trying to accomplish:

I have a page build in Wappler: cat.php. This page holds a table of all the tasks belonging to a certain category.

In the frontend application I pass the category hierarchicaly in the url: mysite.com/cat/maincat/subcat1/subsubcat4/

The category table has a field 'path' and stores the path as a 'Materialized path'; /maincat/subcat1/subsubcat4/ this way I can query the database for all tasks in a certain category (where path like '/maincat/subcat/%' for example).

This method also needs a .htaccess rewrite condition to catch all requests with the url that starts with /cat/ and redirect those to my cat.php page.

I probably could make it myself a lot easier bij using a querystring passing the category id, but I like the names of the categories in the url making it much clearer for the end user where he is.

Is this the (or a) right way to accomplish this? Or is there a much easier way I didn't think of?

Hey Jim and welcome!

Have a look at these Doc links:

If you have furher questions please give us a few info about what you have already done (screenshots, code) in order for us to understand.

Thanks famousmag! I'll look into this. It looks like it can solve (some of) my issues

1 Like