Controlling the detailPages

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

By Perchpole - May 22, 2008

Hello, All -

I've just started constructing my 2nd CMS Builder site. This portal, like the first, is another shop. Instead of dividing the product catalogue into series of physical categories, however, I've opted to follow Dave's advice and created just one main "catalogue" category. All of the products are then presented via various listPages by means of the $options['where'] condition - which is a rather elegant method.

There's only one thing more I'd like to do...

Each listPage has it's own specified detailPage. The boats, for example, are presented on a special marine-style template. That's fine when you're working with a single category - but what happens when everything is bunched together. If I choose to present all of the products on a single "catalogue" listPage (like a giant price list), how can I force each product to open in the detailPage associated with their category?

:o.

Perch

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: [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