Top Level Categories and products

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 16, 2008   (RSS)

Re: [kovali] Top Level Categories and products

By _kate_ - October 16, 2008 - edited: October 16, 2008

Hi kovali,
I'm not sure using a Category Menu is the best method to achieve what you want to achieve.

I've been listing products by type a lot lately and find the below method works quite well. The way I approach it is by making my main product a multi list section (so for example Juices) and then making a list field within it called "Type" or something similar (the types would be Orange Juice, Apple etc).

If you want to display the entire product listing for your top level category, then you simply use the code generated for that products section which will display them all - use the List Page code.

If you want to display sections by Type, you can now do so by adding the red line of code below to the standard List Page code outputted by CMS Builder as shown below.
"type" will need to match the name of your list field, and "Orange" will need to match the type you want to display.

<?php foreach ($juicesRecords as $record): ?>
<?php if ($record['type'] != "Orange") { continue; } ?>

I hope that was helpful. If you have any more questions please don't hesitate to ask :)

Re: [kovali] Top Level Categories and products

By _kate_ - October 16, 2008

Hi again,
In regards to your second question:

Viewer URL
The address of a page used to load records from a Section Editor. There are separate Viewer URL's for your List Viewer pages and Detail Viewer pages. Viewer URL's should point to a page on your server that has been set up with either List Viewer or Detail Viewer code from CMS Builder's Code Generator.

Say for example I have made a multi list section called "Juices", generated the List Page code and saved it in a page called "juices.php". You want visitors to be able to view the details of each juice so you also generate a detail page and call it "juice_detail.php". By specifying the URLs in CMS Builder you are telling it where it can find the information it needs - so if someone goes to "juice.php" and clicks on a juice it knows to use "juice_detail.php" to display the detail info and vice versa.

I hope that helps... maybe someone else can explain it a little better :)

If you have any other questions feel free to ask :)

Re: [_kate_] Top Level Categories and products

By kovali - October 16, 2008

Thx for the advice Kate, will try it your way.

CMSB is new to me and i must say i'm very happy with all the possibilities, very impressive. I understand that it's near to impossible to write a manual for it, but a 'knowledge base' or 'faq' could be interesting, instead of having to dive into the forum posts every time ;-)

Thanks again.