· Martin's BCIM Website Blog ·

M.E.Bush > Misc. > BCIM Website Blog > 2-Sep-2007

Displaying random faces on our PEOPLE page

By now we have a collection of 16 selected BCIM staff photos that we have used for four different versions of our PEOPLE page...
   
The latest version has been there for several months and it's time to replace the staff photos with new ones. However, this time I have decided to create a new version of the page that displays four random faces from a pool. Or rather four pools - one for each of the four positions - so that we always have two male and two female faces and no face appears twice within one rendition of the page. This will have several advantages:
   
I will still need to check - maybe once a year - that all of the staff who have photos displayed are still employed within the Faculty and happy to continue to have their photo randomly displayed.

James used a Javascript function to display random images on the National Bakery School website, so I've used his script as a starting point. I selected a bunch of new photos to add to the ones I've used in the past, deleted one of a member of staff who I know has left, re-sized the others as necessary, and divided all of the photos into four pools - two of male faces and two of female faces. It's taken me a day to put it all together but anyway here is the new PEOPLE page (local copy). At the moment the implementation relies on having the same number of photos within each of the four pools.

Rather than have a fixed Last Updated date displayed within the footer, since the photos are randomly chosen ("generated") I've chosen to make the footer date indicate that the page has been dynamically generated using this snippet of server-side include code (thanks to James again for this)...

<!--#config timefmt="%d %B %Y" -->
Generated: <!--#echo var="DATE_LOCAL" -->
I will make sure that everyone is happy to be included before making it live.