Portfolio >> Programming >> Portfolio

- Portfolio
Apr - 04

This portfolio needed to be easily updated, as I didn’t feel like writing HTML every single time I wanted to add something to it. A combination of flat file php databasing and some solid output code results in the product you’re reading right now.

The way the flat files work is pretty simple to maintain. There is a file that contains the content to generate each directory, and contains the id, name, date, and short description for each entry. A php file takes this list, and explodes it into an array, which is looped through to output a seperate box for each portfolio item. This way, all the HTML is seperate from the actual content, which makes updating very simple and allows me to make sweeping changes to the templates without having to edit every single page.

Then each entry has a long description page built for it using another text file that has the same name as the id from the first text file. Since everything else is the same, the same data can be reused. The templated long description is just a bunch of paragraphs and maybe some links and an image or two. This is just the part where I write up about what I did and why it’s neat. These templates get included into the whole page by another php file, which also calls the style sheets and provides the navbar and the header.

The navbar is a neat little piece too. It’s just another php file that is included, but it determines if we are in a long description or on the index page. If we’re in a long description, the links go back to the index page and start it with that particular entry popped open. If we’re on the index page already, it just pops it open. This was a tricky bit of code to write, not because it was complicated, but because I didn’t know the right way to do it at first. It is a little piece, but graphically, I needed that space filled.

You can also read more about the graphic/web design half of the portfolio.

Portfolio

back...