Designing with PHP Include Files

It’s been much too long since I’ve posted, but from December through this week, I have not only been relocating but also redesigning and recoding my business site, Art By Tech.

I used DIVs and CSS (except some tables in the portfolio, but I’ll be fixing that), and created this lovely plug & play sidebar - isn’t it cute?

First I defined a variable as the current page using $_SERVER[’SCRIPT_NAME’]. Then I check the name of the page and put the conditional include statements: no sidebar for index, sidebar2 for portfolio and contact pages, and my own lovely news sidebar for everything else. Simple.

The power of PHP include files is so incredible - old news I know, but I love to do stuff myself instead of using a CMS. I used them not only for my news & events sidebar, but also to create a dummy sidebar (with if/esleif/else statement) to fake out and eliminate the sidebar (but not the div) for the homepage and portfolio. Include files allowed me alternate style sheetsheet selection, navigation separation, and IE conditional comments. Not to mention the fact that all pertinent info is in an include file so you can access it.

In my 2005 design, I used include files and a kind of complex if/else statement to select the appropriate header image for different sections. The problem is that when I got into that, the design took forever to deploy as I am so finicky about photos.

I probably should have used case for all this instead of if/else. Something to try in my “free time” (ha).

Not much else, but this has inspired me to do more in-depth, serious programming with PHP. I visited Friends of Ed today - a fabulous publisher - to see what was new for CS3 (in the budget with a Mac for 2007) and found this:
The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and PHP

It’s coming out in July and it’s costly, but it’s EXACTLY what I’m looking for. I’ll have to download some other ebooks from them in the meantime.

Sweeeeet!! (Or should I say “Suite”?)

No Comments

Leave a reply