Order by Custom Image Field
I created a custom integer field for images called "Order". I found I can get this data by doing this:
string order = Telerik.Sitefinity.Model.DataExtensions.GetValue(myImage, "Order").ToString();
So I could do custom ordering, However what I would like to do is take my list of Images and use the OrderBy clause.
var images = App.WorkWith().Images().Where(im => im.Parent.Title == "rotator" && im.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live).Get();
foreach (Telerik.Sitefinity.Libraries.Model.Image v in images.OrderBy(im => im.Title))
sb.Append("<
li
><
img
class
=
'sliderImage'
src
=
'" + v.MediaUrl + "'
></
img
></
li
>");
The example above shows how I can order by the strongly typed properties and that works fine. I tried to combine the above two code snippets to figure out how I can order by my custom field but I haven't had any luck. Is this possible? And if you can can someone post a code snippet of how to do it?
Thanks!
Coty
Bump.
Is it possible to get an answer on this today? If it is not possible to order by a custom field than I can write my own but I would like to know before I start, thanks!