[themes] Workflow Question

Larry Garfield larry at garfieldtech.com
Mon Oct 26 03:26:10 UTC 2009


On Sunday 25 October 2009 5:14:06 am Mark Shropshire wrote:
> Thanks to the original poster for bringing up this issue. It has been
> great to see some different approaches for theming in Drupal.
>
> Zirafa,
>
> I definitely agree with your last statement that there is no real
> "right" way for theming. I think there are best practices and we have
> seen a few of those in this email thread. I have to admit that I have
> actually done the same thing with downloading foundation and renaming
> the theme folder.
>
> Thanks,
> Mark

There is no one right way, but there certainly are wrong ways. :-)  Large gobs 
of PHP logic in your template files is a Wrong Way(tm), regardless of whether 
you're using a base-theme approach or a from-scratch approach.  (That's what 
preprocess functions are for.)  And if you put SQL in a template file I will 
hit you. :-)

Also remember that the HTML Drupal spits out to you by default is already very 
extensive and complete, and more importantly is dynamic.  As your site 
evolves, the structure of the HTML will change, too.  Not page.tpl.php, 
necessarily, but what CCK fields you have will change over time, what Views you 
have will change over time, blocks will get added and shift around, etc.

I highly recommend the "sustainable theming" blog series by Colleen 
Carroll[1].  It discusses the practical benefits of "trusting Drupal" and going 
"with the grain" of the CMS in your theming just as you should in your code.  
There are cases where you don't need or or shouldn't, but in the long run 
you'll save yourself time by leveraging what Drupal already gives you as much 
as possible.

[1] 
http://www.palantir.net/blog/colleen-carroll

Specifically (I need to yell at our site admin to shorten URLs...):
http://www.palantir.net/blog/sustainable-markup-how-be-a-themer-drupal
http://www.palantir.net/blog/graycor-drupal-theming-works
http://www.palantir.net/blog/drupal-theming-getting-your-hands-dirty-and-
building-house
http://www.palantir.net/blog/drupal-theming-applying-sustainable-method-views

-- 
Larry Garfield
larry at garfieldtech.com


More information about the themes mailing list