Category Links

2 posts by 2 authors in: Forums > CMS Builder
Last Post: December 13, 2011   (RSS)

By Kenny - December 13, 2011

I know I have done this plenty of times before, but I am having so many problems with trying to get URL searching to work with what I am doing.

I have a products section that list various products as normal (tile, description, etc.) I have another section called categories, where the client can start adding categories.

In the products section, I have a dropdown list that displays the available categories.


Get options from a MySQL Database

Section Tablename: category
Use this field for option values: num
Use this field for option labels: title



On the page, I want to list all of the categories and when you click on one, it will take you to the products page where any product in that category will be displayed.

The link looks like this:

<a href="../products.php?category=<?php echo $record['num'] ?>"><?php echo $record['title'] ?></a>


which translates into this: /products.php?category=3


I want the url to look like this for search engine optimization purposes:

/products.php?category=Cattle Guards

So I tried putting:
<a href="../products.php?category=<?php echo $record['title'] ?>"><?php echo $record['title'] ?></a>

When I do that, no products come up.

What am I missing?