Main Content

Two PHP include files to make easy web site indexing and navigation

Archive - Originally posted on "The Horse's Mouth" - 2008-06-21 14:02:26 - Graham Ellis

My 'work' in campaigning for an appropriate train service on our local "TransWilts" line started three years ago now (!) with the Save the Train web site ... and grew to include the First Great Western coffeeshop (forum) covering all services in a wedge to the West of London, once we realised that we're not alone here in Wiltshire in feeling that the Passenger (and want-to-be passenger)'s voice doesn't get heard in the corridors of power at the Department for Transport, at First Group, and at the various town and county halls - that public rail transport is an area where the customer is NOT always of top priority to the specifier, operator or public servant.

There's a steadily increasing flow of "documents" associated with all this work - ranging from informational photographs to show locations through spread sheets and timetables and other documents released to us under Freedom of Information and other disclosure rules ... and a need to make them more easily available. And so the site at raildocuments.org.uk which Lee (of canber) is looking after.


How to look after these documents? Well - for the initial stages I've used two simple PHP files that can be called up from the home page (or any other page, come to think of it!)

The first script - (see code here) - generates links to all the subdirectories which have their own home pages, and it references them by the subject of the index page.

The second script - (see code here) - generates links to all the individual files within other specified subdirectories.

Together, the two provide a quick and neat set of navigation tools to allow users to find the document the need quickly and easily on a site of modest size, and provide the site owner / maintainer with a structure in which he can add in extra resources / documents without having to go through a procedure to update all the links and indexes.

See the current docs using the scripts here ...