21309 Posts in 5738 Topics by 2603 members
|Go to End|
15 July 2010 at 10:35am Last edited: 15 July 2010 10:40am
I'm trying to build a slideshow that allows it's images to be managed from the CMS instead of some other non-CMS way.
Using this tutorial on how to create a "quotes" object:
and this tutorial on object relationships:
I've been able to create a very nice slideshow class that uses a ComplexTableField to retrieve a list of images.
However, I don't understand how to order my images other than the default order of creation. For each image in my ComplexTableField I've included a field in the cms to enter a number. The plan here is to use that number as a weight to order the list. I'm looking for something like "Order by $SlideOrder ASC" or whatever the equivalent might be. ($SlideOrder is the name of the field I want to order by.)
E.g. Now my table looks like this and it displays in this order:
$Image - $SlideOrder
ImageA.jpg - 3
ImageB.jpg - 1
ImageC.jpg - 2
So they display 3, 1, 2. I'm trying to get them to display 1, 2, 3.
15 July 2010 at 11:19am
For adding sorting / ordering then you want to check out the DataObjectManager (DOM) module which adds this functionality and a bunch of other stuff. http://silverstripe.org/dataobjectmanager-module/
15 July 2010 at 1:23pm
I do believe, that's what I'm looking for.
|Go to Top|