Random node selection
mrfelton - July 24, 2008 - 11:51
| Project: | Rotor Banner |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mrfelton |
| Status: | closed |
Jump to:
Description
I would like to be able to select nodes at random rather than only displaying the first x nodes. The attached patch adds this functionality. This is the first time I have written a patch for the Drupal community - I hope the format is ok.
| Attachment | Size |
|---|---|
| rotor_random.patch | 2.33 KB |

#1
changing status to patch attached
#2
Hey, haven't tried this patch yet but I read it to check if you were doing this with jQuery Cycle, I just realised that Cycle has a randomizer built in :)
Read number 4 on http://malsup.com/jquery/cycle/begin.html
Would this work? Seems like a nicer way to do it seeing as we've got the jQuery Cycle in as a patch.
#3
Also if you're going to do it with jQuery Cycle we could close this issue and roll it into the jQuery Cycle patch at http://drupal.org/node/278722
#4
I think the best thing might actually be to use a combination of this patch (which does it at the database level - selecting items from the database at random, up to the item limit that was defined in the admin page), AND using cycles built in randomisation. This way we will get a random selection of images from all the images available AND they will be rotated through in a random order. Perhaps 2 admin options too - random selection, and random rotation.
#5
Ok I see, I forgot about the limit.
What reminds me of http://drupal.org/node/256512 what talks about having the ability to have multiple rotor blocks created. If that feature is created we'd have to make sure it was possible to select what was displayed in a rotor block and then this could do it's random thing. Probally not relevant at the moment but it just passed my mind.
#6
#7
Automatically closed -- issue fixed for two weeks with no activity.