Manage your content with PHP
by Volker Weber
In this article we’ll build a simple, template-driven site that separates style, content, and structure in your website. We’ll create a cross-browser stylesheet switcher that remembers the user’s preferences, touching on php variables, cookies, if statements, and including pages with require_once.
The separation of style from content has become the bugbear of the HTML developer. Traditionally, we’ve used well-written CSS and XHTML to achieve this separation, and we’ve seen how much easier it is to update our sites or provide multiple styles when we write our markup this way. By adding some very basic PHP to this mix, we can take this modularity a step further, making it easier not only to update our styling, but our structure as well. In essence, we can create our own basic Content Management System.
Comments
A propos PHP & content management. Why reinventing the wheel? There are a number of opensource CMS based on MySQL and PHP out there.
The one I think is best by far is Typo3 http://www.typo3.com. A Danish project, it has a huge following. It is becoming a typomania in Germany. It is a bit tricky to start with, but after successfully having passed those first hurdles, typo3 offers endless possibilities. The user interface is nice and thought through. The soon coming extension manager is a real breakthrough.
It's opensource and can be downloaded from sourceforge (or via typo3.com). If you don't want to spend time on the server config, typo3server.de is offering a hosted typo3 preconfigered solution. Typo3server.de is also publishing a nice doc in German for the first steps.
Have fun...
Moritz