[themes] although it’s a very powerful CMS, I didn’t have the greatest time with it as it came to be one of the most cumbersome and roundabout pieces of software...

Vladimir Zlatanov vlado at dikini.net
Wed Jun 14 12:25:32 UTC 2006


>  «roundabout» It is. The theme layer is, very much like a theme-spaghetti. 
>  The longest theme trace in general Drupal is: 
>   Page » node » engine » core » engine » comment » engine » details » 
> username » link
>  Inbetween we move two times out of "views" mode and let the theme engine call 
> core, call teh theme engine. And so on. 
The path is true and that can be avoided but might not be very wise. It will add 
a lot of constraints on what is themeable and what not, unless we overhaul not only
the the theme layer but the way drupal works.

The recent attempts to redo the theme system Adrian, Karoly, Dries and
me are doing come from a few observations.

* From a designer's perspective it is not easy to find out what is
themeable. And when they find it there is a high chance that is php
code. Ooops. Hard to read and grasp if you are not a coder.

* Different theme pieces are scattered around the codebase. Again, hard
to find.

So we are undertaking two things, split all modules into their own
directories. Take out all theme functions into their own files living
either in the appropriate module directory or in a new templates
directory. Some of the phpteplate's internals now live in theme.inc
We are trying not to make this stuff slower or more memory hungry.

This will hopefully help to find themeable components. Those which make
sence should be migrated to mainly html with some php as opposed to the
current state.

Creating a new theme from scratch can even be done like copy all tpl.php
files into a directory. Change all files to suit you. Presto completely
new look drupal. 

The complicated threading of theme-code-theme-code-... is still there,
but far more unnoticeable. Potentialy that is. In the end it does
reflect the application flow.



More information about the themes mailing list