phil : php-ized uvic templates
php-ized the philosophy site to reduce duplication of code, especially in banner, navigation and footer areas.
All the hardcoded stuff in the header, banner, footer has been moved to header.inc, banner.inc and footer.inc.
I've created a getSectionPage.php file which figures out the names of the current page and section so the correct nav items can be displayed and hilited. The code is very simple: assumes a two-level nav system, all pages are within a second-level (and only the second-level) folder and that the secondary nav is displayed in left column. It would be easy to write something similar for the default secondary nav system. It would take a bit more thought to abstract a bit to create something that could more easily be used with either scheme for secondary navigation.
The primaryNavbar.php and secondaryNavbar.php use the values calculated by getSectionPage.php to display the correct navigation state.
On each page the head section consists of the following:
<!-- InstanceBeginEditable name="doctitle" -->
<title>University of Victoria - Philosophy</title>
<!-- InstanceEndEditable -->
<?php include '../includes/header.inc'; ?>
<?php include '../includes/getSectionPage.php'; ?>
The start of the body section looks like this:
<?php include '../includes/banner.inc'; ?>
<div id="tabholder">
<div class="center">
<?php include '../includes/primaryNavbar.php'; ?>
</div>
</div>
and the leftcol div looks like this:
<div id="menu">
<ul id="SecNav">
<?php include '../includes/secondaryNavbar.php'; ?>
</ul>
</div>
Finally, the footer div looks like this:
<div class="center">
<?php include '../includes/footer.inc'; ?>
</div>
Each empty page is now much smaller than it was, and of course it's much less work to make any changes to the header, banner, navigation and footer areas for all the pages. I tried to retain all the dreamweaver-specific comments, but have not tested to see what DW can do with the php-ized files and how that conflicts with the dreamweaver template system.