Theming Drupal - A Well Worn Stretch on the Drupal Learning Curve
On the way to the Summit of Mount Shasta in Northern California you must ascend Misery Hill. This particularly tough stretch of climbing is aptly named as it is a real challenge after having just completed a difficult approach across the south face and starting to enter serious altitude. Learning Drupal theming often feels like climbing Misery Hill, especially to people coming to Drupal from a front end web development background who know HTML and CSS but do not have experience with PHP or with Content Management Systems. This was me.
HTML + CSS expertise != PHP Know-How
My beginnings of web development were in writing HTML and CSS. I love writing HTML and CSS. I think there is value in lean, semantic markup and love well thought out, creative CSS that give the markup a beautiful design. When I found Drupal I realized that the translation of my skill set would be doing what people call "Theming". Theming is often used to describe different things, but for me it means making the output of Drupal match a particular design. This should primarily happen in CSS in my opinion but often manipulation of the markup must happen as well. Learning to manipulate the ouptut of the Drupal was the beginning of Misery Hill for me. I felt completely over my head as I googled looking for answers to my questions trying to understand what "overriding a theme function" and "phptemplate_variables" meant. The theming section of my copy of Pro Drupal Development is well worn from reading and reading and re-reading trying to understand the concepts. My main takeaway from going through the process of learning, very slowly and painfully, what all these things are is that a basic understanding and demystifying of PHP could have gone a long way to easing my way up Misery Hill.
Progress in the Ecosystem
Things are different now. Drupal has changed since those days and so has the ecosystem around the system. One of the biggest changes is the wealth of resources for learning to work on Drupal as a front end developer. There are great instructional podcasts, books and even a DVD learning series on Drupal theming. These are all very high quality and have contributed to the integration of designers into the community and education of how to learn as a Drupal Front End Developer. One of the more recent and very exciting efforts to help educate people about some of the things, like a minimal knowledge of PHP, that were personally challenging is the Design to Theme project from Emma Jane Hogbin. Emma Jane is an author and trainer and Design to Theme is the place where she is leading workshops and writing about Drupal theming. Recently Emma Jane published an ebook titled "Theming Drupal: A first timer's guide" that is a a fantastic starting place for someone new to PHP and creating Drupal themes. "Theming Drupal: A first timer's guide" covers many of the very subjects that drove me up a wall trying to figure out as I started with Drupal theming, some of my favorite sections include:
- Template Variables
- Adding Style Sheets
- Conditional Output ("if" statements are important to teach PHP noobs!)
- Zen Theme
- Node Template Variables
- Customizing Blocks (especially the bit here about tpl naming suggestions)
- Accessing Content in the $node Object (oh the hours spent learning to pick apart $content!)
- Designing with Grids
- the ebook also includes a sample node.tpl.php with great example code
The ebook is well organized with code samples throughout and explanations of concepts that make sense. I highly recommend this ebook to people who are coming to Drupal theming from a similar place as I came from - a strong understanding of HTML and CSS but little to no knowledge of PHP(or any dynamic language).
A Climb Worth Making
As you get to the top of misery hill on Mount Shasta the final leg of the summit is exposed and you can see the fruit of your labor as you look back over the path to where you are that leads up steep terrain. As you make your way up the Drupal learning curve keep putting one foot in front of the other and take advantage of all the opportunities to ease the pain through immersing yourself in the richness of educational materials and amazing community as your journey continues.