Picture
Jennifer Lampton Guest Trainer
May 15, 2011

There are a lot of great things about being a Drupal Trainer. My favorite is getting to see -- first hand -- how the code we write affects the community. I noticed that with the release of Drupal 7 - the demand for training on theme development increased dramatically. It took me a while to figure out why - exactly - but after a night of heated Debate in IRC with chx, mikey_p, HedgeMage, heyrocker, and yoroy (among others) we may have arrived at a conclusion. Chx pointed out that the best Drupal themes are made by developers - people who know Drupal really well, and understand all the code. Even though he is probably right (and most of the themers we have at Chapter Three really are developers, too) I have always seen the theme as the entry point for people who are new to Drupal. I assumed this was because the template files (the ones ending in tpl.php) were written in HTML - and this is a language most people in web are already familiar with. It's the piece of the system that, until recently, seemed the most approachable. So what changed? People who aren't entirely comfortable with PHP seem to have no problem reading logic in template files, things like seem to just make sense. But things like make people pause. Words like 'if' and 'print' are pretty easy to figure out, even if you don't know any PHP - they're just English, and thus self explanatory. Based on the amount of explanation I usually need to provide in my theme classes on arrays vs objects, I think it's the presence of these data structures in template files that scares people off. When what they saw in there was they were fine, they just worked around it and let it be. But when that became they could all of a sudden see that there was something else there that they didn't understand, and they start to think "Maybe it's better just to leave it alone." The last thing our community needs right now is a decrease in the number of new people who are jumping into code and giving it a shot. Those people with the ambition and do-it-yourself attitude are going to be our next jr devs, and maybe even our next experts! We need them in our community to support the huge growth in Drupal adoption. In a lot of ways I think the Drupal 7 theme system is vastly superior to Drupal 6, but was the decision to use data structures in templates a mistake? Work has begun on removing these data structures from the top most levels (http://drupal.org/node/1158090) Join the discussion and let us know what you think!