Today’s CMS systems work by providing an environment for a developer to work in. You modify the data in the admin panel and them CMS provides a method of inserting the HTML it generates into your templates.
However, therein lies the problem -- the output is generated by the CMS. The CMS should exist to provide a user friendly abstraction to the websites dynamic content. It should not tell the frontend how to represent that content.
To anyone reading this, please be aware that any examples I give will be framed within the context of the MVC pattern and more specifically the Lithium PHP framework. Why? Because these are the tools I love to use at the time of writing this document, although there is no reason that this couldn’t be adapted.