Shai, Thanks a lot ..
regards Ram
--- On Fri, 3/4/09, Shai Gluskin shai@content2zero.com wrote:
From: Shai Gluskin shai@content2zero.com Subject: Re: [support] Random Display of articles To: support@drupal.org Date: Friday, 3 April, 2009, 6:21 PM
Ram,
You are welcome. And it was Pavan who first answered, I just picked up from him.
FYI -- For anonymous users, if you have caching turned on... I'm pretty sure this approach will not work like you expect it to. The query runs, it picks a random choice... but then then the whole page is cached and presented to non-authenticated users the same way every time (refreshing page makes no difference) until you change something on the page which causes the cache to be overwritten or until you clear the cache.
For logged-in authenticated users I'm pretty sure it will work as you are expecting it to.
Best,
Shai
On Fri, Apr 3, 2009 at 7:21 AM, ram prasath ramprasath_explicit@yahoo.co.in wrote:
HI Shai,
MY HEARTY THANK'S TO YOU
I did display the way you said and I found my articles displaying in ascending order in that global Random.And my article is getting changed on every page refresh is any other to display my articles without page refresh in random
Regards Ram
--- On Fri, 3/4/09, Shai Gluskin shai@content2zero.com wrote:
From: Shai Gluskin shai@content2zero.com Subject: Re: [support] Random Display of articles To: support@drupal.org
Date: Friday, 3 April, 2009, 4:29 PM
Ram,
"Random" is not an attribute like "ascending/descending".
Rather... it is its own field to sort or on. Click on the drop-down for adding another field to sort on... go through the list slowly and you'll see "Random" as a choice.
You might, if I remember correctly, even be able to set ascending/descending as an attribute after you have added Random as a new sort field. That, of course, makes no sense and it makes no difference what that attribute is set to.
I needed help in a similar situation as well; it really is counter-intuitive for "Random" to be a field to sort on. But we do love Views, so we'll take it with its warts.
Good luck,
Shai
On Fri, Apr 3, 2009 at 6:25 AM, ram prasath ramprasath_explicit@yahoo.co.in wrote:
Hi Pavan, Thank you..But I didn't find sort criteria random .I found sort criteria ascending and descending only....Can u tel me how to set a sort criteria random
regards Ram
--- On Fri, 3/4/09, Pavan Keshavamurthy pavan.k.murthy@gmail.com wrote:
From: Pavan Keshavamurthy pavan.k.murthy@gmail.com
Subject: Re: [support] Random Display of articles To: support@drupal.org Date: Friday, 3 April, 2009, 2:15 PM
Create a View(A block view), Set number of nodes to 1, filter your content
type (article), and set sort criteria to random.
Pavan Keshavamurthy
On Friday 03 April 2009 12:52:50 ram prasath wrote:
Hi Friends,
I have 10 articles I want to display only one article at a time inside a block and the articles must be randomly choose from that 10 articles. After every page refresh I want a random article to be displayed inside the
block..
CAN ANY 1 TEL ME HOW TO DO IT......
THANKS IN ADVANCE FRIENDS
Regards Ram
Check out the all-new Messenger 9.0! Go to
hi, ok, so i'd like to display one block from a set list of blocks randomly in one particular region - like, latest news, latest articles, advert etc (each with different designs). for anon views, i wouldn't really mind if it only updates when the cache expires.
after looking through the module list, i didn't seem to find anything suitable, so i've considered writing my own module - like a block switcher module where modules for one region are randomly switched, but before i do, is there already something that could actually do this out there, just not well known?
thanks
It sounds more like a code snippet than a module proper. Shouldn't be more than about 4 lines of code. Create a block, set it to PHP mode, and make the contents something like the following (this is untested code, mind you):
$blocks = array('my block 1', 'my block 2', 'my block 3'); $key = rand(0, count($blocks)-1); $block = module_invoke($blocks[$key], 'block', 'view', 0); print $block;
On Sun, Apr 5, 2009 at 6:15 PM, George g@8vue.com wrote:
hi, ok, so i'd like to display one block from a set list of blocks randomly in one particular region - like, latest news, latest articles, advert etc (each with different designs). for anon views, i wouldn't really mind if it only updates when the cache expires.
after looking through the module list, i didn't seem to find anything suitable, so i've considered writing my own module - like a block switcher module where modules for one region are randomly switched, but before i do, is there already something that could actually do this out there, just not well known?
thanks
[ Drupal support list | http://lists.drupal.org/ ]