Pagelist Random Image

Summary: Display a random image using the page list directive
Version: 0.1
Prerequisites: Pmwiki version 2.2, Cookbook:ThumbList
Status: Production
Maintainer: Simon
Categories: Images PageList

Questions answered by this recipe

How do I display a random image from those uploaded to the wiki?

Description

Use the following page list template to create a sitemap.

Implementation

  1. Install Cookbook:ThumbList
  2. Add the following to your Site.LocalTemplates.

#randomimage

display a random image

>>comment<<
[[#randomimage]]
(:template default order=random count=1 if="attachments" list=normal:)
(:template each:)
(:thumblist {=$FullName} px={$$px} link=2 order=random count=1:)
[[#randomimageend]]
>><<

(:pagelist fmt=#randomimage list=normal count=8 px=128:)

(:template default order=random count=1 if="attachments" list=normal:) (:template each:) (:thumblist {=$FullName} px={$$px} link=2 order=random count=1:)

(:thumblist PITS.01454 px=128 link=2 order=random count=1:) (:thumblist PmWikiDe.CustomActions px=128 link=2 order=random count=1:) (:thumblist Cjc.20070428 px=128 link=2 order=random count=1:) (:thumblist Cookbook.ServePageByJSON px=128 link=2 order=random count=1:) (:thumblist PITS.00575 px=128 link=2 order=random count=1:) (:thumblist PmWiki.AdminTask px=128 link=2 order=random count=1:) (:thumblist Cjc.20070102 px=128 link=2 order=random count=1:) (:thumblist Cookbook.WordPressAudioPlayer-Users px=128 link=2 order=random count=1:)

In a page copy the above page list directive modifying it as necessary, eh

(:pagelist fmt=#randomimage list=normal group=Photographs count=1 px=256:)

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See Also

Contributors

Comments

See discussion at PagelistRandomImage-Talk

User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.