group sub categories

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

Re: [IronVictory] group sub categories

By Dave - July 17, 2008

Hi IronVictory,

Depending on how your list page is setup, the easiest way to group them might be to just sort by subcategory and then title on your list page. Your order by might look like this (in red):

list($records, $recordMetaData) = getRecords(array(
'tableName' => 'products',
...
'orderBy' => 'sub_category, title',
...
));


If that doesn't do it let me know some more details and we'll help you figure it out!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] group sub categories

Hi Dave,
This is what I have for the viewer and it just repeats. I need $record['sub_category'] as the title, then the thumbnails listed below.

<?php foreach ($productsRecords as $record): ?>

<div class="prod_title"><?php echo $record['sub_category'] ?> <?php echo $record['category'] ?></div>

<?php foreach ($record['product_image'] as $upload): ?>
<div class="prodlist"><a href="<?php echo $record['_link'] ?>&category=Sinks"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo $record['productName'] ?>" border="0" /></a><br/>
<?php echo $record['model'] ?></div>
<?php endforeach ?>

<?php endforeach; ?>

Re: [IronVictory] group sub categories

By Dave - July 18, 2008

What is it repeating? Is it sorting the subgroup items together, though?

Do you have an url that you can post? Let me know some more details and I'll try and help! :)
Dave Edis - Senior Developer
interactivetools.com