Custom sub-sort order?

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

By ncasares - May 27, 2009

I have a question that's semi-related to this post:
http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/folder_of_uploaded_images_P71859/

I have a multi-record editor of images with a custom field for category. So far I can display images based on a query for a particular category. The sort order is following the order defined in the editor (DragSortOrder).

My challenge is that I'd like to define a custom sub-sort order for each category. Right now if I search for images in category_a and order them in the editor it changes the order of photos in category_b if any of the photos are in both categories.

Technically, I understand why this is happening (since all images are in one table). Is there any work around for defining a sub-sort order for each category? I thought about using a third field called "category sort order", but that gets messy for the end user.

I'd love to retain the drag and drop functionality of DragSortOrder. I don't want to split each category into a separate photo editor because many of my photos need to show up in multiple categories and this would force me to upload images more than once.

Maybe I'm asking too much here? This is a sharp group so I thought I'd see if anyone has some insight.

Thanks.

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