Getting A View to "ORDER BY RAND ()"

View: New views
5 Messages — Rating Filter:   Alert me  

Getting A View to "ORDER BY RAND ()"

by Shai Gluskin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a need for Views to "ORDER BY RAND ()"

The use-case is that I want to pull in the teaser of a particular content-type for one node only onto the home page. I want it to randomly select the node it displays.

Everything is easy except the random part. The home page is a panel page. I've built a view, filtered on content-type, set the number of nodes to display at "1" -- successfully pulled it into the panel.

I thought the way to do this would be to set a sort criteria. But I see only "ascending" and "descending" -- I don't see "random" as a choice.

Any ideas?

I'm using Drupal 5.8,  Views 1.6 and Panels 2 Beta

Thanks,

Shai

--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Getting A View to "ORDER BY RAND ()"

by Paul Kim-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There IS a sort criteria called "Random" in the drop-down list. You're
probably not looking closely enough.

Shai Gluskin wrote:

> I have a need for Views to "ORDER BY RAND ()"
>
> The use-case is that I want to pull in the teaser of a particular
> content-type for one node only onto the home page. I want it to
> randomly select the node it displays.
>
> Everything is easy except the random part. The home page is a panel
> page. I've built a view, filtered on content-type, set the number of
> nodes to display at "1" -- successfully pulled it into the panel.
>
> I thought the way to do this would be to set a sort criteria. But I
> see only "ascending" and "descending" -- I don't see "random" as a choice.
>
> Any ideas?
>
> I'm using Drupal 5.8,  Views 1.6 and Panels 2 Beta
>
> Thanks,
>
> Shai

--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Getting A View to "ORDER BY RAND ()"

by Brian Choc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Add the criteria “Random” (it’s listed as a field) … does that do what you’re looking to do?

 

Brian

 

 

From: support-bounces@... [mailto:support-bounces@...] On Behalf Of Shai Gluskin
Sent: Tuesday, July 15, 2008 4:12 PM
To: support@...
Subject: [support] Getting A View to "ORDER BY RAND ()"

 

I have a need for Views to "ORDER BY RAND ()"

The use-case is that I want to pull in the teaser of a particular content-type for one node only onto the home page. I want it to randomly select the node it displays.

Everything is easy except the random part. The home page is a panel page. I've built a view, filtered on content-type, set the number of nodes to display at "1" -- successfully pulled it into the panel.

I thought the way to do this would be to set a sort criteria. But I see only "ascending" and "descending" -- I don't see "random" as a choice.

Any ideas?

I'm using Drupal 5.8,  Views 1.6 and Panels 2 Beta

Thanks,

Shai


--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Getting A View to "ORDER BY RAND ()"

by Craig Jackson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Under Sort Criteria, select Random as the field.

Craig

On Tue, Jul 15, 2008 at 4:12 PM, Shai Gluskin <shai@...> wrote:

> I have a need for Views to "ORDER BY RAND ()"
>
> The use-case is that I want to pull in the teaser of a particular
> content-type for one node only onto the home page. I want it to randomly
> select the node it displays.
>
> Everything is easy except the random part. The home page is a panel page.
> I've built a view, filtered on content-type, set the number of nodes to
> display at "1" -- successfully pulled it into the panel.
>
> I thought the way to do this would be to set a sort criteria. But I see only
> "ascending" and "descending" -- I don't see "random" as a choice.
>
> Any ideas?
>
> I'm using Drupal 5.8,  Views 1.6 and Panels 2 Beta
>
> Thanks,
>
> Shai
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Getting A View to "ORDER BY RAND ()"

by Shai Gluskin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Brian, Paul, and Craig,

Duhh. Okay, now I see it. I thought I'd have to chose the field and then expected random to be in the drop-down that has ascending/descending.

But it's not that way, so my eyes missed it.

Thanks much, this is perfect.

Shai

On Tue, Jul 15, 2008 at 6:15 PM, Brian Choc <bchoc@...> wrote:

Add the criteria "Random" (it's listed as a field) … does that do what you're looking to do?

 

Brian

 

 

From: support-bounces@... [mailto:support-bounces@...] On Behalf Of Shai Gluskin
Sent: Tuesday, July 15, 2008 4:12 PM
To: support@...
Subject: [support] Getting A View to "ORDER BY RAND ()"

 

I have a need for Views to "ORDER BY RAND ()"

The use-case is that I want to pull in the teaser of a particular content-type for one node only onto the home page. I want it to randomly select the node it displays.

Everything is easy except the random part. The home page is a panel page. I've built a view, filtered on content-type, set the number of nodes to display at "1" -- successfully pulled it into the panel.

I thought the way to do this would be to set a sort criteria. But I see only "ascending" and "descending" -- I don't see "random" as a choice.

Any ideas?

I'm using Drupal 5.8,  Views 1.6 and Panels 2 Beta

Thanks,

Shai


--
[ Drupal support list | http://lists.drupal.org/ ]


--
[ Drupal support list | http://lists.drupal.org/ ]
LightInTheBox - Buy quality products at wholesale price