This month marks the 12th year since I hoisted my first HTML file on a web server and flicked on the switch. Since then, my master directory of web content files has something like 50 or 60 thousand documents, a sprawling metropolis of stuff.
In talking recently about our web sites, I realized in the last year, my development or addition of new project or event web sites is driven my a goal of creating fewer, not more web pages. This is largely achieved via some solid lessons and methods re-used in PHP, where an entire web site can have 1 template, an external library of functions and code bits, and sub directories of content files. I do some with database, but quite a bit is done with just arrays of data, or content plucked from text files.
This is one of the things weblogs quietly achieve for us, managing display via templates, keeping content and formatting apart, allowing massive visual design changes by swapping themes. It gets folks focusing on the conten they are creating, not the FONT tags, the color codes, or the image alignments.
For example, I never build navigation links in my sites. I have a single function, that reads an array of possible link URLs and targets, and builds the nav links on the fly, and it knows to mark the page in view in a different manner. This flexibility is key, as somewhere down the line, a program manager will wander in the office and say, “Can we add a new section to the web site on policies?” or “Can we move the link for the profiles further up the page?”.
If navigation links are hand coded across many pages, you face a lot of hand editing, or some clever search and replace. With my approach, I just need to re-order an array, or add a new array item, and I am done.
I have one master PHP include file that does the footers in hundreds of PHP pages, automatically entering the page name, the modification date, the correct URL.
I recently needed to make some updates and add new content to one of our program sites that’s been around since 1999. It was a collection of perhaps 70-80 static HTML files, not all the navigation links were the same on all pages, it was an ugly set of nested table content.. With PHP, I was able to get our Maricopa Institute for Learning site down to 6 PHP template pages, all with consistent design, move the main design out of tables into pure CSS, and toss in some more stylistic formats.
Yes, my new goal is to create fewer web pages.
Fewer Web Pages by CogDogBlog, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.