If I have a View and want a certain sort order, how would you guys approach it? My solution is to just break it apart in the tpl.php file, but I’m curious if there’s a better way. So let’s say we have days of the week (just an example, could be other items, but this seems universally available). I can’t sort alphabetically, I need it to be Sunday, Monday, Tuesday, etc. Thoughts? Joel
I did this with RSVPs the other day and needed Yes, No, Maybe. The way I approached it was to stack attachments on each other. So the pages was Yes, the first attachment was maybe and the second attachment was no. Hope this helps. -Steve On Fri, Mar 25, 2011 at 8:18 AM, Joel Willers <joel.willers@sigler.com>wrote:
If I have a View and want a certain sort order, how would you guys approach it? My solution is to just break it apart in the tpl.php file, but I’m curious if there’s a better way.
So let’s say we have days of the week (just an example, could be other items, but this seems universally available). I can’t sort alphabetically, I need it to be Sunday, Monday, Tuesday, etc.
Thoughts?
Joel
-- [ Drupal support list | http://lists.drupal.org/ ]
-- Steve Kessler Owner and Lead Consultant Denver DataMan, LLC 303-587-4428 Learn To Secure Success<http://www.denverdataman.com/ddm_events/2011-03-24t220000/secure-your-success>
On Fri, 25 Mar 2011 09:18:57 -0500 "Joel Willers" <joel.willers@sigler.com> wrote:
If I have a View and want a certain sort order, how would you guys approach it? My solution is to just break it apart in the tpl.php file, but I’m curious if there’s a better way.
So let’s say we have days of the week (just an example, could be other items, but this seems universally available). I can’t sort alphabetically, I need it to be Sunday, Monday, Tuesday, etc.
There are many variables you didn't specify, so I'm going with the most common denominators. This is untested, so the details may need tweaking, but one option is that you can include the actual date field as part of your "Fields", specify that it be "Exclude(d) from display" (when you configure it), and use it for your "Sort criteria".
Thoughts?
Joel
-- Jason Flatt Custom Website development solutions: http://www.oadaeh.net/ Father of seven: http://www.flattfamily.com/ (Joseph, 18; Cramer, 16; Travis, 14; Angela; Harry, 10; William, 5; and Dolly, 2) Linux user: http://www.ubuntu.org/ Android user: http://www.android.com/ Drupal fanatic: http://drupal.org/
This can be approached in several ways. Nodequeue http://drupal.org/project/nodequeue Draggable Views http://drupal.org/project/draggableviews Additionally, using CCK you can use a parent content type with a multi-value node reference field and display the view at the bottom of the parent node. This is useful for creating multiple gallery instances and things like that. http://drupal.org/project/views_attach might also be relevant On Fri, Mar 25, 2011 at 8:44 AM, Jason Flatt <drupal@oadaeh.net> wrote:
On Fri, 25 Mar 2011 09:18:57 -0500 "Joel Willers" <joel.willers@sigler.com> wrote:
If I have a View and want a certain sort order, how would you guys approach it? My solution is to just break it apart in the tpl.php file, but I’m curious if there’s a better way.
So let’s say we have days of the week (just an example, could be other items, but this seems universally available). I can’t sort alphabetically, I need it to be Sunday, Monday, Tuesday, etc.
There are many variables you didn't specify, so I'm going with the most common denominators. This is untested, so the details may need tweaking, but one option is that you can include the actual date field as part of your "Fields", specify that it be "Exclude(d) from display" (when you configure it), and use it for your "Sort criteria".
Thoughts?
Joel
-- Jason Flatt Custom Website development solutions: http://www.oadaeh.net/ Father of seven: http://www.flattfamily.com/ (Joseph, 18; Cramer, 16; Travis, 14; Angela; Harry, 10; William, 5; and Dolly, 2) Linux user: http://www.ubuntu.org/ Android user: http://www.android.com/ Drupal fanatic: http://drupal.org/ -- [ Drupal support list | http://lists.drupal.org/ ]
participants (4)
-
Carl Wiedemann -
Jason Flatt -
Joel Willers -
Steve Kessler