Effective template system

Posted by Alex on Programmers See other posts from Programmers or by Alex
Published on 2012-02-17T20:17:43Z Indexed on 2012/04/07 17:46 UTC
Read the original article Hit count: 324

Filed under:
|
|
|

I'm building a content management system, and need advice on which theming structure should I adopt. A few options (This is not a complete list):

  1. Wordpress style:

    • the controller decides what template to load based on the user request, like: home page / article archive / single article page etc.
    • each of these templates are unrelated to other templates, and must exist within the theme
    • the theme developer decides if (s)he want to use inner-templates (like "sidebar", "sidebar item"), and includes them manually where (s)he thinks are needed.
  2. Drupal style:

    • the controller gives control to the theme developer only to inner-templates; if they don't exist it falls back internally to some default templates (I find this very restrictive)
  3. Funky style:

    • the controller only loads a "index.php" template and provides the theme developer conditional tags, which he can use to include inner-templates if (s)he wants.

Among these styles, or others what style of template system allows for fast development and a more concise design and implementation.

© Programmers or respective owner

Related posts about php

Related posts about design-patterns