[development] Strip out theme functions into a .theme file

Nick Wilson nick at communicontent.com
Sun Aug 6 10:14:04 UTC 2006


* and then Bèr Kessels declared....
> Op donderdag 3 augustus 2006 19:37, schreef Nick Wilson:
> > Just getting developers to make sure tables and other html elements have
> > unique id's or classes would be wonderful -- im all for this, but i
> > think it would be beneficial if some of the theming functions *required*
> > these optional attributes.
> 
> We had a long thread abotu this when I tried to introduce exactly this in a 
> theme_wrapper() http://drupal.org/node/23584
> I hoped that would become a general "add some HTML around this string" 
> function. It enforced unique IDs and allowed nice classes.

That looks to be a near perfect fix, particularly as it's so clean and
quick. 

> But it seems the community is split when it comes to this: developers want to 
> include only the IDs and CLASSes they need for their case: fair enough. The 
> themers part of the community has been begging for some guidelines in IDs and 
> classes for ages. 

I can't see the dev's point of view here. Having to supply an additional
class name or two seems a very small price to pay for giving the
designers a whole heap more flexibility and making Drupal easier to work
with. 

> For that latter group I decided that we need to do this on the theme level: 
> its "our" domain ;)
>  I therefore aim at, what I call brickslate, an engine that makes sure you 
> receive proper IDs and CLASSes, consistently names, in nice, useful and clean 
> HTML. 
>  The first step towards this can already be seen in the phptemplate theme 
> whatisinitsname: 
> http://cvs.drupal.org/viewcvs/drupal/contributions/themes/whatsinitsname/ and 
> http://webschuur.com/taxonomy/term/65

Am i understanding you right, that this uses theme_wrapper()?

> I am now finishing up the first theme I built on top of this frame, and so far 
> I am impressed. I designed a pure CSS theme with only CSS, with hardly ever 
> changing the actual HTML I outputted, and I found the naming iof the IDs and 
> classes very easy to grok and remember. But I will refrain from releasing 
> anything, untill I have build more themes on this base. With this you can 
> help, by using it and giving feedback :) After all "the proof of the pudding 
> is in the eating" (or so)

I'm planning on doing just that. But here's something to think about:
phptemplate is messy, mixing html with php -- actually, i find
phptemplate truly horrid, and only work with it if i have too -- if
you're tying to get drupal to be cleaner coded, why not use the Smarty
engine instead of phptemplate aswell?

> I suspect that if we get such a theme system running properly and get it 
> sorted out to be the perfect HTML generator after some time, that thatwill 
> trickle back into core and contribs. Then contribs and core can start to 
> follow the consistent naming conventions we introduced!

Sounds good, but i think just the enforcement of theme_wrapper() would
be the best way forward as it's clean and quick and really doesn't
require a great deal more effort from devs...

-- 
Nick Wilson
http://performancing.com/user/1


More information about the development mailing list