View Single Post
  #1  
Old 11-25-2002, 11:25 PM
 
mgale mgale is offline
 

Newbie
  
Join Date: Sep 2002
Posts: 5
 

Default Passing variables ... revisited

Having spent 6 hours trying to figure this out I now appeal to the knowledgable individuals on this list ....

Standard way to call up products is to click on the category link which is <a href="home.php?cat={ $categories[cat_num].categoryid }">.

This calls home.php which "requires" a bunch of other php pages and ultimately displays home.tpl, which in turn calls subcategories.tpl, which then calls products.tpl, and the products are displayed. the "cat={ $categories[cat_num].categoryid }" is apparently what assigns the category variable and keeps it so the correct subcategories and/or products are displayed.

What I want to do is have each category call a unique page, which I can then customize (and search engine optimize) for THAT particular category.

What I've done so far:

Changed the link to: <a href="category{ $categories[cat_num].categoryid }.php"> which calls, for example, category1.php.

Then I copied home.php and renamed it category1.php, and changed the call to display category1.tpl (instead of home.tpl).

I copied and renamed home.tpl to category1.tpl.

So, instead of going home.php?cat=1 --> home.tpl, I have the exact same files called as category1.php --> category1.tpl.

Everything displays fine ... EXCEPT I CANNOT figure out how to get the variable of the category number passed through the php (and/or smarty) so the variable controls WHICH subcategories and products are displayed.

I've tried adding an assign to category1.php - didn't work. Tried adding an assign to category1.tpl (before it calls subcategories.tpl) - didn't work. I've probably tried a zillion different variations of trying to get the value of "1" (the categoryid) assigned as the $Cat variable. No go.

HELP!!!

It can't be THAT hard, can it? What am I missing here?

All help appreciated ... I am on a crunched time frame and beginning to really wig out.

Marie
Reply With Quote