Using category num in URL

14 posts by 4 authors in: Forums > CMS Builder
Last Post: September 15, 2009   (RSS)

Chris,
that did work. Thanks. I unlocked the password protection so you could see my page:http://www.jdg-siouxlandscale.com/siouxland_scale_products/index.php?category=2

This is something I am trying to wrap my head around. I set up a Categories table. Set up my products table pulling in the db of categories. On this page I am pulling in one random product from the list of products on the left side. On the right side are my products list. What I am trying to do is when you click on a product on the right - to then go to a page exactly like the example, but now have that products info to the left with the same listed category products on the right. So random product now has the requested product info and the product list to the right is the same. Which shouldn't be difficult, but I am lost.
I can't figure out how to add category link to the product links on the right side. This make any sense. Am I going about this the right way?

Re: [petejdg] Using category num in URL

By Chris - September 2, 2009

Hi petejdg,

That's a little more complicated than the original problem. Attached is my solution to your problem. Hit it with ?category=1 and it'll generate links to select the other records. If you call it without a query string, it'll select the first product in your database with the default sort order and choose the category that product is assigned to.

Hope this helps! Please let me know if you have problems getting this set up.
All the best,
Chris
Attachments:

producthybrid.php 3K

Thanks, that works great. My only problem now is the navigation system, which wigs out cause I am not passing a category through when clicking on the product from the list on the right. I believe I will need to pass the category number, but that ruins the random product code. Is there quick work around for that?