random page from page list

Permalink
is there a way to display a random page from a page list without going into the controller? the random code should be in the custom template.

basically i want my page list template to select 1 random page out of 3 to 5 pages.

possible?

 
goldfish replied on at Permalink Reply
goldfish
A quick hack is you can make a custom template, and before the line:
for ($i = 0; $i < count($cArray); $i++ ) {

insert a line shuffle($cArray);

Will definitely drag performance - I don't think the page will cache. Then insert a pagelist that only displays 1 item, and select your custom template.