[support] Views: sort by arbitrary field value

Gerald Klein jk at zognet.com
Tue Mar 13 15:01:10 UTC 2012


Or simpler add 1 file as integer and use that as the sort value number like
10,20,30 or depending 100,200,300 then you can stick in between later.

--jerry

On Tue, Mar 13, 2012 at 8:52 AM, Joel Willers <joel.willers at sigler.com>wrote:

> You could do sorting in the .tpl.php, if need be. Also, you could call the
> view programmatically, creating an array of sort terms, then filter by the
> node type, stepping through a loop of each term.
>
> Views is quite robust in capabilities, but specific search order isn't as
> kind. I suppose you could try something a bit more funky, building a
> content type that just has a weight and another content type, then use
> relationships to display the view. Or maybe add a weight field to each
> existing content type, setting a default to each one, then sorting by
> weight, like 1 for news, 2 for blog, 3 for page. Taxonomy could also do
> some fun stuff with sorting.
>
> Hope that gives you some ideas.
>
> Joel
>
>
> -----Original Message-----
> From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
> Behalf Of DTH
> Sent: Monday, March 12, 2012 3:43 PM
> To: support at drupal.org
> Subject: [support] Views: sort by arbitrary field value
>
> Say I have a view that lists all the nodes on my site. Say I have three
> content types: page, news, blog.
>
> If I sort by content type, I can only sort by ascending or descending
> order: e.g. "blog, news, page" or "page, news, blog".
>
> What do I need to do if I want the articles to be sorted in an order of my
> choosing, say "news, blog, page"?
>
> (I guess I could create separate views for each content type and attach
> them, but what if I had thirty content types, say, and added more regularly)
> --
> [ Drupal support list | http://lists.drupal.org/ ]
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>



-- 

Gerald Klein DBA****

www.geraldklein.com <http://geraldklein.com/>****

jk at zognet.com****

708-599-0352****


Linux registered user #548580



The below contributed statements are well....funny and I apologize if
someone is offended.....not.


Unix is user-friendly. It just isn't promiscuous about which users it's
friendly with. - Steven King



Frustrated Windows users have two options.

1. Resort to throwing computers out of windows.

2. Resort to throwing Windows out of computers


Ever realized that if you play Windows CD backwards you'll hear satanic
messages?

But that's nothing! If you play it forward it will install Windows.


"Ubuntu" -- an African word, meaning "Slackware is too hard for me".


The day Microsoft makes a product that doesn't suck, is the day they make a
vacuum cleaner.

Linux is like a wigwam: no gates, no windows and Apache inside. *(Chinese
proverb c. 910 B.C.)*

**

** **

"being a Linux user is sort of like living in a house inhabited by a large
family of carpenters and architects. Every morning when you wake up, the
house is a little different. Maybe there is a new turret, or some walls
have moved. Or perhaps someone has temporarily removed the floor under your
bed" – Unknown****

** **

Customer: I'm running Windows...
Helpdesk: Yes...
Customer: ...and now my computer stopped working !
Helpdesk: Yes, you already said that.****

** **

The box said "Requires Windows 98 or better."****

So I installed Linux.****

** **

I ran the Microsoft Malicious Software Removal tool****

but Internet Explorer is still installed on my computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120313/6670972a/attachment.html 


More information about the support mailing list