If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Setting up this blog meant working with WordPress for pretty much the first time (I’d set up the odd install before, but never customised). It also meant working with a WordPress theme for the first time (DIY’s Thesis—great stuff).
Needless to say, this got me thinking about templates, and how they’re handled in PHP applications. I don’t really know a lot about how things are done out there (I’ve worked with Joomla a tiny bit, and really wasn’t impressed, especially with the template system), so I was quite curious to see how templates are handled in WordPress.
Templates in Renaissance are very simple. They’re XHTML markers with markers where Renaissance is to insert content, and some XML at the top containing various bits of system information about the template. The XHTML fragment starts and ends with the body tag. There ain’t no PHP or anything like it in there. Due to the fact that Renaissance writes most of your mark-up for you, the XHTML is usually pretty light. This isn’t atypical for a Renaissance template in its entirety:
So, it’s pretty simple, as you can see. The $…$ bits are the markers telling Renaissance to insert content.
When constructing a page, the user tells the system which template they’d like to use for that page and links in the content they want in each content area (Renaissance uses a system which separates pages from their content). When Renaissance displays the page, it reads in the template, inserts the appropriate bits of content and wraps it all up in the correct XHTML header and footer.
To me, that’s how templates are meant to be. Just structure and design information. Decent design, XHTML and CSS skills should be all that’s required to put a template together.
So, anyway…
You can probably see where all this is going. I was pretty fairly shocked to see that WordPress and its themes (and probably just about everything else in the PHP world) has a bunch of PHP in their templates, something I’d given up years ago as seeming clunky and hard to maintain. This also necessitates that the these templates are actually the things that are read and executed by the web server when a page is requested, which again seems bizarre to me.
Surely templates are about design?
I appreciate that WordPress is working on a completely different paradigm than Renaissance in terms of its templates. It’s my belief that templates are one hundred percent design, and should therefore be created by designers and plugged into the system for use by administrators and editors for creating pages. Flexibility is achieved through Renaissance’s very versatile content syndication system.
WordPress and similar apps, on the other hand, seem to believe that templates are executable entities, and therefore in the hands of coders. I’m sure there must be advantages to this system (I can only think of speed), unless it’s pure inertia that are keeping things this way? Personally, I can’t imagine telling a designer or client that they need to learn PHP and Renaissance’s framework before they can alter the design of their site.
What do you think?
P.S. More to come on templates soon; I’ve got a whole bunch of ideas on how to develop them in Renaissance. I know my template for this blog needs work too!
No related posts.
{ 2 comments… read them below or add one }
Joomla Designer 10.30.08 at 12:51 am
Hi Rob,
I agree, Joomla can be a real pain…because it’s using a combination of .php, html and .css.
It can be tamed however…but it takes a lot of work!
Cheers!
Rob Chant 10.30.08 at 1:05 am
Thanks for the comment. I guess either way you’ve got CSS to handle, but I think mixing PHP with HTML in a template is a no-no personally!
Rob