Controlling the detailPages

6 posts by 3 authors in: Forums > CMS Builder
Last Post: November 10, 2008   (RSS)

Re: [Perchpole] Controlling the detailPages

By Dave - May 22, 2008

Hi Perch,

Second site, way to go! :)

There's a few ways to have different products link to different pages. One way would be to use a naming convention for your viewers. So say you have a variable called $record['categoryName'] you could name your detail viewer /categoryNameDetail.php and then setup a link like this:

<a href="<?php echo $record['categoryName']; ?>Detail.php?<?php echo $record['num']; ?>">View Product</a>

So then if the category was called "widgets" you'd get a link like this: widgetsDetail.php?123

But if your category was called "sprockets" you'd get: sprocketsDetail.php?456

So that's one way, do you think that would work for you? If not we can come up with something else. Let me know if you need more details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Controlling the detailPages

By Perchpole - May 24, 2008

Hi, Dave -

This method seems to work rather well. In fact, the only place it doesn't work is on the Multisearch results page.

Care to have a fiddle?

:o)

Perchpole

Re: [Perchpole] Controlling the detailPages

By Dave - May 26, 2008

Hmm, multisearch wasn't build to support that.

I could either add an additional option that let you pass along an extra field from each table (we could call that 'extraField1') which you could use to pass along categoryName and create the link based on that.

Or... or you could create a viewer "categoryDetail.php" that did nothing but load the record and then redirect to the right viewer.

What do you think? Would either of those options work for you?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Controlling the detailPages

By chassa2556 - November 10, 2008 - edited: November 10, 2008

Could I jump in on this thread I have a site that has two categories of shows 'current show' and 'past show'. &#10;&#10;I am trying to control the detail page so that when it is linked to from the list page it only shows the correct category detail page. For example I am wanting to link from the list page with the category 'current shows' to the detail page with the same 'where' category filter at the top.&#10;&#10;I have added the code.&#10;&#10;<a href="<?php echo $record['Current Show']; ?>Detail.php?<?php echo $record['num']; ?>">See more</a> &#10;&#10;And have set up my detail viewer to be /categoryNameDetail.php as suggested above. But it isn't recognising it. &#10;&#10;Any ideas?

Re: [chassa2556] Controlling the detailPages

By Dave - November 10, 2008

Hi chassa2556,

Can you post an url and the files?

Thanks.

Also, for some reason your posts have &#10; characters in them? Not sure why that is happening.
Dave Edis - Senior Developer
interactivetools.com