Hi,

I'd like to add a "random page" feature to my site, similar to http://en.wikipedia.org/wiki/Special:Random on Wikipedia (meaning: simply a link that directs to a random node).

How do I accomplish this in Drupal?

Thanks & greetings, -asb

Comments

asb’s picture

Hi,

thanks. There's exactly one module, that comes pretty close to the "Random Page" feature: Stumble. However, it seems not to work very reliable :-(

Greetings, -asb

WorldFallz’s picture

Though not obvious, it can also be done with views using the "global: random" sort option and setting the view to return only 1 item.

asb’s picture

> Though not obvious, it can also be done with views using the "global: random" sort option and setting the view to return only 1 item.

Thanks, that would be an interesting alternative - if there was such an option in Views 1. Ironically, the Stumble module works pretty well in the D6 version (where Views 2 with the "global: random" sort option would be available), but has an critical bug in the D5 version: #613616: You have an error in your SQL syntax.

To make this real fun: According to the module's author, this is not a bug in the Stumble module, but in Drupal core: #284392: db_rewrite_sql causing issues with DISTINCT. So this (yet unsolved) issue has to be fixed in D6, and then be backported to D5. So there won't be a working "Random article" in D5 for a while.

Greetings, -asb

WorldFallz’s picture

This post is tagged d6 so I gave you the d6 option, but it does exist in d5-- it's just named "Random" in the views1 sort options drop down.

asb’s picture

> it does exist in d5-- it's just named "Random" in the views1 sort options drop down.

Immediately tried this, and it worked like a charm (opposed to the 'stumble' module which would add an addition memory footprint to the site).

That's what I call a real solution! ;-)

Thanks you very much for your hint!

Greetings, -asb