I have a view that selects several nodes by certain sort criteria, say date. Some of these nodes have been labelled sticky.
I would like to reorder the list so that the first sticky appears at the top of the view, and the remaining nodes remain in date order.
Is this possible?
I've tried doing this at the template level but have no idea how to, and I don't think creating a sort handler will help as i'm not sure how I would create such a query.
Any help would be much appreciated.
NOTE: If you are interested in what functionality i ultimately want, I am essentially designing the frontpage of a newssite. The frontpage will contain all stories in date order (recent at the top) however I should be able to select a main story which should appear at the top regardless of its date.
Comments
In the sort section of the
In the sort section of the Views UI, add the Sticky sort before the created sort. This has the affect of ordering by Sticky first then by date.
Very common use case.
Thanks but it is a more complicated then that
Scott,
Thanks for taking the time to respond. Unfortunately my case is a bit more complicated, as I want only the very FIRST (the latest) sticky to go at the top, all remaining articles including any remaining stickies to be sorted by date.
I have found the following which may help me, but lets see. http://www.davidnewkerk.com/book/121
then you want nodequeue
then you want nodequeue module http://drupal.org/project/nodequeue
originally written by Earl, creator and maintainer of Views.
edit: oops should have click that link. Yes use nodequeue. If you need that fine grain control that is the way to go.
It sounds to me like this
It sounds to me like this might be accomplished with two views. One view returns the most recent stickied post only, and the other view sorts the same material by date. Hide the first view when you are on the second page of results, etc... and I think you are done.
Thank you all.
Thanks all,
I adopted Scott's final solution.
David (Keyz) wrote a great tutorial on how to do this which can be found here: http://www.davidnewkerk.com/book/121
Thanks!