Sorting Bug

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 15, 2010   (RSS)

Re: [mark99] Sorting Bug

By Jason - April 15, 2010

Hi,

dragSortOrder is a field in the section that stores the order that the products appear in the section editor. If you rearrange them on the page, you'll see your results change. If you want to to just sort on name however, remove dragSortOrder from the line so it just reads: "title ASC" or "title DESC".

You can control the sort order on the viewer in a couple of ways.
1) you can control it from the URL by setting the createdBy variable to any field name (example: www.mysite.com/results.php?orderBy=title)
2) you can add an orderby command to the mysql string.
Example:
<?php
list($productRecords,$productMetaData)=getRecords(array(
'tableName' => 'products',
'orderBy'=> 'title ASC',
));
?>


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/