Custom sub-sort order?

5 posts by 4 authors in: Forums > CMS Builder
Last Post: June 16, 2009   (RSS)

Re: [ncasares] Custom sub-sort order?

By ross - May 27, 2009

Hi there.

Thanks for posting!

Do each of your categories have their on physical page? If so, you can actually use the orderBy option on each page to manually override the ordering.

Right after your "where" clause, add in:

'orderBy' => 'FIELD NAME',

Give that a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Custom sub-sort order?

By ncasares - May 27, 2009

Hi Ross,
Thanks for the quick reply. This is actually what I'm doing now.

The snag is that I'd like to use DragSortOrder since it lets the client order photos visually. Since I only have one table of photos this approach means I only get 1 defined sort for DragSortOrder.

I guess what I'm really looking for is a way to sub-sort visually based on a filtered list of photos. Probably not doable, but I thought I'd pose the question.

I think something like this would require a third join table and making that work visually in the editor is probably asking too much [:)]

Re: [ncasares] Custom sub-sort order?

By Dave - June 1, 2009

One way would be to sort by category name, then dragSortOrder in the editor... But that's not really supported (I think you'd have to change the sort order in /data/schema/ to do it) and may have some unexpected results.

Also, if a image appeared in multiple categories I'm not sure how you'd indicate the sorting for both at the same time.

Another approach would be to have multiple sort order fields (or a custom one) and have an external app that let you update them (with a mysql UPDATE query). Not sure if that would be worth the effort though.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Custom sub-sort order?

By Toledoh - June 16, 2009

I had a similar issue here, staff were members of multiple areas within a business, however, the heirarchy was always different.

I ended up having a bunch of text fields for each of the different areas (categories) and a number indicating the order they should be in.

I view the team via the URL teamList.php?category=XXXX

The List viewer code is;
list($peopleRecords, $peopleMetaData) = getRecords(array(
'tableName' => 'people',
'where' => 'category LIKE "%<?php echo $_GET['category']; ?> %"','orderBy=<?php echo $_GET['category']; ?> ',
));


Seems to work!
Cheers,

Tim (toledoh.com.au)