[support] Views help

Joel Willers joel.willers at sigler.com
Fri Mar 25 15:30:08 UTC 2011


>In the case where the data I want to sort on 
>isn't sortable I create a new field that is. So 
>if it's day of the week then I'll create a 
>day_idx field eg. Sunday - 01, Monday - 02 etc..

This is an interesting idea, but I find it would take a lot of infrastructure work, whereas editing the tpl.php would give me more diversity in the future.  For instance, if I want to sort by content type by not by Alpha order.  Also, if the order would change, I can just edit one file.  Of course, if I have multiple views, I have to have multiple tpl's.  

>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. 

This is the way I have it now, but changing these takes modifications to Views.  If I decide to change the order (which is what's happening now) I can't easily move the attachments around.

>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".

Yes, this would work for specific dates, but not so much my needs.  In a mysql database, you can specify enumerated fields, or in any database you can use a lookup table (similar to the first suggestion above) and then use references and sort by the index.  I think this is the solution I'll end up using if ever I have multiple views to avoid multiple tpl files, but it seems the tpl file is the best place for me to do this, unless someone else has another suggestion.  

Thanks for the help, Marty, Steve and Jason!

Joel


More information about the support mailing list