Displaying random pages from embedded page lists

I had a new client meeting in London yesterday and we talked about a number of things, most of which InForm can do right out of the box but a few of them were new ideas that I hadn't yet considered.

One of these was whether or not we could show a random image from a choice of images and that this would (maybe) change when the page is reloaded.

After some thought it seemed that the best way to do this would be to integrate it into the ability to embed a list of links to pages into a page. We already have the architecture to let us choose the pages that are associated with the list, and a page can have a Page Image associated with it and therefore we can pick a random page from the list and show it the image associated with it.

So, if we start with a very simple page list such as...

...then we can change the format of the list, for example to include more meta-data about the pages...

  • closeguantanamo.org is a pure InForm site that campaigns for the release of prisoners from Guantánamo Bay. Fonts are provided by typekit.com to help generate the strong visual identity.
  • loopcollective.org is a pure InForm site with a tight integration to bandcamp and uses the index support to cross-reference press releases across different parts the site.
  • mcfalls.co.uk is a content rich pure InForm site which tracks the live and studio work of the ensemble. The site utilises customisable banners to provide different identies per section, and embedded paypal for e-commerce.

...then all we have to do is to create a new template to do the random selection, register it among the list of available templates and it automatically becomes part of the CMS and can be selected like so...

Each time we reload the page, a new random page is chosen (which might or might not be the same as the previous page) and the appropriate page is used. The other bonus is that the list is a well behaved block and can be rescaled and floated like any other block - we have another copy of the same random list floated beside this paragraph.

Not only do we get the random image from the page, but we also get the appropriate random functionality - ie you can click on the random image and get taken to the page that it represents.

I'm going to play around with the different other bits of meta-data that we might like to include such as titles and descriptions, and also whether or not showing more than one random image - eg "should me 3 random thumbnails from the following list" and see what comes out the other end, but for now I think that this is an approach that has definite potential...