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.

CommentFileSizeAuthor
rotor_random.patch2.33 KBmrfelton

Comments

mrfelton’s picture

Status: Active » Needs review

changing status to patch attached

SeanBannister’s picture

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.

SeanBannister’s picture

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

mrfelton’s picture

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.

SeanBannister’s picture

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.

mrfelton’s picture

Version: 6.x-1.2 » 6.x-1.3
Assigned: Unassigned » mrfelton
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.