Search A-Z index Help
University of Cambridge Home Physics Dept Home Mike Roses' Home Page TCM Group Home

Dynamic web-site menus with php based upon directory structure and recursive code

Requirements:
  • a left hand side menu that would do sub-menus as deep as you like based upon directory structure of the web-site
  • control which directories are linked to on lhs menu using menu.txt file in each directory

a website using this code (as of 12/2007)

This is the first recursive code I've written and it would certainly be done in a better way. The code starts at the web-root whereas it would be just fine recursing up from the sub-directory.

the key bit of php code for generating the left hand menu, recursively

a tar archive of an example website with dynamic left menu, done using the Cam Uni house-style (you'll need a Raven account to get hold of this file)