Reorder News Items

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 8, 2008   (RSS)

By Mohaukla - January 8, 2008

How do you reorder news items in the list view?

Is it possible to have them drag and drop as in the Sections Editor area?
Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"

Re: [justritedesign] Reorder News Items

By Theo - January 8, 2008 - edited: January 8, 2008

Michael,

Thanks for posting!

How do you reorder news items in the list view?


You want to update the $options['orderBy'] value in your list viewer page. This might currently be blank, or it might have one or more values already in, like:
$options['orderBy'] = 'date DESC';
Here are some common special sorting commands that you can use:

* fieldname DESC - The suffix "DESC" will sort the field in descending order (i.e. backwards). Attached to a date fieldname, this will sort the newest records first.
* fieldname+0 - sorts the field as a numeric value. Use this suffix if you are sorting numbers, but the sorting is coming out in a strange order (1, 2, 20, 21, 3, 4, 45, etc.).
* RAND() - Sorts the results in a random order. The results will be randomized every time the viewer is loaded.

If you need some help on some specific ordering requirements, please post and we'll see what we can do!


Is it possible to have them drag and drop as in the Sections Editor area?


Drag-sorting records is on the request list. I think it's a great idea, I think I brought it up to Dave while I was testing out 1.00 release candidate. :)
Theo Wiersma

Re: [Theo] Reorder News Items

By Mohaukla - January 8, 2008

Would it be possible to actually number each of the items (for now - until the drag and drop functionality is implemented) by adding a field that we could issue a number to and then use the "order by" option to set them up. I would need help figuring out, if it is possible.

Any idea when you might be able to implement that functionality? That would be a huge selling point for a lot of my clients.
Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"