Top Level Categories and products

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

By kovali - October 16, 2008

Hi,

I've created an editor (Menu Type = Category Menu) to show a list of products in a website. There are about 6 Top Level Categories which all contain about 10 products each. For example:

Juices
- Orange Juice
- Apple Juice
- Tomato Juice
- ...

Wines
- Bourdeaux
- Champagne
- White wine
- ...

Is there a way to link to a Top Level Category that will show only this Top Level Category and all the products it contains ? I tried the MySQL "where" (and also "Like") clause but this doesn't same to work well for me. See my code below pls, i used a selectbox $record['type_categorie'] to be able to use different css styles to Top Level Category title and it's products.


<?php

require_once "/home/vosab/public_html/beheer/lib/viewer_functions.php";


list($assortimentRecords, $assortimentMetaData) = getRecords(array(
'tableName' => 'assortiment',

'where' => 'name LIKE "%Wines%" or name LIKE "%Bourdeaux%" or name LIKE "%Champagne%" ', ));


?>

<h1>Assortiment - List Page Viewer</h1>
<?php foreach ($assortimentRecords as $record): ?>

Productgroep: <?php echo $record['parentNum'] ?><br/>
Benaming: <?php echo $record['name'] ?><br/>
Type categorie: <?php echo $record['type_categorie'] ?><br/>
Omschrijving (NL): <?php echo $record['content'] ?><br/>

<?php foreach ($record['foto'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>


<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>


<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>


<?php endif ?>
<?php endforeach ?>



<?php foreach ($record['pdf'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>


<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>


<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>


<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->



<hr/>
<?php endforeach; ?>


<?php if (!$assortimentRecords): ?>
No records were found!<br/><br/>
<?php endif ?>


Second (general) question: I don't understand the function or meaning of "Viewer Urls"... what is this used for? Example ?

Thanks !!

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.