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...- First version (as of Oct 2005)
- Second version (as of Apr 2006)
- Third version (as of Oct 2006)
- Fourth version (as of Apr 2007)
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:
- it'll look nicer (arguably) to have random faces displayed,
- I will no longer have to worry about updating the photos periodically,
- I will be able to add or delete faces from the four pools at any time, for example as staff leave or a nice new photo comes to my attention.
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.