Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

Sort Order of front end control.

Go to End



Community Member, 219 Posts

30 August 2010 at 1:52am

I have a table that displays a list of products uploaded through ModelAdmin.
all is working well so far, but i cant seem to get the sort/order to work.

My client needs to be able to manage the order the list as they require, first i hoped they could arrange it in the CSV file, then upload it and the order would be displayed on the front end. but that failed.
then i tried using:

class Catalogue extends Page {
      public function ProductList ($filter = null){
if(!isset($_REQUEST['start'])) $_REQUEST['start'] = 0;
$limit = $_REQUEST['start'].",25";
$order = 'Title DESC'; 
return DataObject::get('Product', $filter, $order, null, $limit);

this ALMOST works, but the order isn't consistent!
I can't figure out why it's doing this?
it seems like it only orders by the first character? so my results are something like:


does that make sense?

ideally, i have a column in my CSV file called DisplayOrder, that the user can number all parts in the order he wishes them to appear and upload it. but again, it only seems to order by the first digit of the number, and there are over 700 products so its useless!

can anyone help?