[pmwiki-users] Randomize Pages

The Editor editor at fast.st
Sun Mar 25 06:31:07 CDT 2007


On 3/25/07, [] Jamie <followtheboat at gmail.com> wrote:
> I wondered if there is a recipe for randomising extracts of page content? On
> my wiki home page I'd like to insert a box taking up a quarter of the page,
> or half a paragraph, which text wrapping round it, and for the recipe to
> grab the first three lines or so of a random page. That way whenever a
> visitor hits the home page they see a bordered box with constantly changing
> content.
>
> If I've not explained that very clearly then please take a look at the
> homepage to my website (not the wiki). If you hit refresh you'll see that
> the image, the quote in the top right and the 'Random Log Entry' all change
> every time the page refreshes. It's a lazy way of making the page look
> dynamic I guess.
>
> As an adjunct to this I wondered if there is a way of including only an
> extract of a page, rather than the whole page?
>
> Any ideas?


You can do this I think with a pagelist.  If you look at the pagelist
docs, you can set something like order=random, get it to return 1 item
(count), and limit to the first x lines.  Note lines are based on hard
returns, not how many soft returns are on the page.

Hope this helps.

Cheers,
Dan



More information about the pmwiki-users mailing list