My Journey Into the Land of Drupal

Posted: September 25, 2012

Share:

In my years of developing for the web, we have gone through many transitions.  I remember using the Photoshop splice tool to generate table-based websites for me.  I remember moving to xHTML and CSS and developing static HTML sites in Dreamweaver.  I then used my first CMS, Textpattern, and began to love the lack of redundancy that I gained by using a more intelligent system than Dreamweaver.  Soon after my short time with Textpattern, I moved on to developing in Expression Engine.  It was here that I developed my first love affair with a CMS.  I feel so empowered by the openess of Expression Engine.  I had developed mainly on EE for the past four or so years and I have loved it.

Recently, we at VisionPoint Marketing have had more Drupal projects coming in and this has given me the opportunity to work with Drupal 6.  I am currently leading a Drupal project for a community college client and it has been an adventure to say the least.  I was brought on to the project about halfway through it with absolutely no Drupal knowledge at all.

I will go ahead and warn everyone, it was not the easiest transition at all.  Every CMS I have dealt with, maybe by pure luck, has done things in relatively simliar fashions.  I had no problem picking up WordPress or dealing with the occasional proprietary systems that clients have.  

I still don’t understand a lot of the decisions made when it comes to Drupal’s functionality. Sometimes I think this is the double edged sword of completely open-source software, but the one thing I do understand is when working with Drupal, it is best to suck it up and do it Drupal’s way, even if it doesn’t make sense to you.

Drupal is a very powerful and endlessly expandable content management system.  There is a huge army of independent developers behind the project who continually work to make Drupal more and more useful.  But it is its own beast entirely.  There are a few challenges I had that I want to outline here to maybe help anyone else who may have to make the jump from seasonsed veteran of a CMS to complete beginner in Drupal.

Let Go of Your Code

This was by far the biggest challenge for me.  I am kind of a code nazi.  I think a web page should have as few div’s as humanly possible.  I don’t like the excess use of classes if not needed.  I like things to be named by the exact naming conventions that I use for websites.  I like content to always use headers in the same manner.  I like to have stylesheets set up in a per section inherited format.  To put it simply, Drupal and I were heading toward a frustrating collision.  I had to finally realize that no amount of finessing and working within the system is going to give me the perfectly clean code I want, and I just need to deal with that. 

It is not like there aren’t advantages to this system. I gain the ability to have regions and blocks, the ability to quickly tweak views without even looking at code, the knowledge that assuming I adopt Drupal’s standards then I should be able to write pretty universal CSS for different parts of the website, as well as others.

Not being in complete control of my code still feels weird but it is part of the Drupal beast.

Learn to Love Views

When first looking at the views screen in Drupal, I wanted to pull my hair out.  I saw about a million options to create something that I could just write EE code for in about five minutes.  It seemed extremely frustrating when I already knew a way to do it, but it was not Drupal’s way.  I attempted to create a view to get the right content into the variable array on page and then code the same way I would in EE, and to put it short, that was more frustrating than learning how to use views.  Drupal is just different from EE and the knowledge does not really transfer well.

Once I went through a few too many tutorials, I began to grasp the idea of views and how to implement them in a template.  I still don’t always grasp exactly how to rewrite fields exactly how I want or why the fields shown are linked to the view and not the display, but embracing the idea of views allowed me to use a lot of Drupal’s other features like auto-creating blocks, easy use of the pager, creation of simlar pages without having to touch any code, as well as other things.

Views are intimidating and scary, but with time, they can be your friends.

Embrace the Global Template

When developing in EE, I generally use a module called Structure,  This module gives me one of the most powerful abilities, in my opinion, that EE has.  On a page by page basis, within the content editing screen, I can select what template a page uses.  I use this ability all of the time and love it!  It is great to have the ability to make pages of the same content type, in the same section of a website look completely different if you so choose.  (This is especially true when you have Dwight McKnight designing your websites).

Drupal does have the power to have per node (page) templates given you are willing to use a complicated naming structure to create a new template file each time you want to do it, but it is not nearly as easy as it is in EE.  Drupal takes on the idea of tempaltes very differently, a Drupal site has on global template that rules them all.  Any other template just modifies a specific part of a page.  I am used to having 20+ templates on the average EE site granting me complete freedom with my coding.  Understanding the template flow and inheritance used in Drupal was difficult.  There are very specific naming conventions and considerations to take into account when building Drupal templates.

I have done more template modification than from scratch building at this point, but I have still found advantages to understanding this method.  The first advantage to a single template running the whole system is that Drupal, unlike EE, exists in the same look and feel as the front facing website.  For some users this is easier and more familiar than a separately styled backend like EE has.  At the same time, if the website is cluttered, the backend will now also be cluttered. 

Secondly, if your inheritance is done correctly, you should be able to make changes to the site while touching fewer templates than you would have to in EE.  This of course can be dangerous for the same reason, you can inadvertantly make changes to more of the site than you were aiming to. 

It really is just a different system that generally embraces less, more far-reaching templates rather than more, targetted templates.

Where I Currently Stand

I still love Expression Engine.  If I had a choice, I would still choose EE first without many second thoughts.  That said, once I learned to try to live in Drupal’s world rather than trying to mold Drupal to my style of development, everything became easier and more of the advantages of the system became apparent to me.

A lot of times, I see people saying that experience and time will cause you to like any CMS more and more, but I think with Drupal there is an important caveat that this experience and time need to be spent making websites Drupal’s way not trying to make Drupal make websites your way.