Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mezzoblue.com:
Simple Templating (with HTML/CSS/PHP)
Jun 09, 2005 @ 12:43:58

On Mezzoblue.com (frm Dave Shea, author of The Zen of CSS Design) today, there's this new article posted about the creation of a very lightweight templating system, including a few handy CSS tricks.

I use a very lightweight templating system of my own devising on this site that strikes me as something that might be of value to someone, somewhere. No database required, although you could certainly use one in conjunction with this method if you feel so inclined. This is pretty basic stuff, so feel free to skip this one if you're an old hand at server-side scripting. Then again, it sets up a lot of the CSS tricks I use around here, which may prove interesting even so.

[...] My system on this site (which uses PHP, but once used ASP, so the concepts themselves are portable if not the code) consists of taking a comprehensive HTML file, and deciding what's meat and what's filler. The filler can easily be pulled out into a separate file, leaving only the meat within each individual page, which is as minimal as possible. On this site, I've determined that the page headers, sidebars, and footers are all filler. The sidebar and footer appear next to each other in the markup, so I've combined them into a single file.

He gives some sample code/HTML to give you an idea of how the PHP, HTML, and CSS all tie together to make the pages that you see on their site...

tagged:

Link:


Trending Topics: