group sub categories

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

I am trying to display "sub categories" grouped on a page like this:

Main category title
Sub category 1 title
- product thumbnail
- product thumbnail
- product thumbnail
Sub category 2 title
- product thumbnail
- product thumbnail
- product thumbnail

I have a list field set up as 'sub_category' in the 'products' section.
How can I group the sub category products on the main category page?

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