Controlling the detailPages
6 posts by 3 authors in: Forums > CMS Builder
Last Post: November 10, 2008 (RSS)
By Perchpole - May 22, 2008
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
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.
interactivetools.com
Re: [Dave] Controlling the detailPages
By Perchpole - May 24, 2008
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
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?
interactivetools.com
Re: [Dave] Controlling the detailPages
By chassa2556 - November 10, 2008 - edited: November 10, 2008
<a href="<?php echo $record['Current Show']; ?>Detail.php?<?php echo $record['num']; ?>">See more</a>
And have set up my detail viewer to be /categoryNameDetail.php as suggested above. But it isn't recognising it. Any ideas?Re: [chassa2556] Controlling the detailPages
By Dave - November 10, 2008
Can you post an url and the files?
Thanks.
Also, for some reason your posts have characters in them? Not sure why that is happening.
interactivetools.com