phoboslab

How Not to Build a Page with Drupal

A few weeks ago I was asked to build an Intranet-Site for a small company. Nothing too fancy – just the usual groupware stuff like News, Calendars a Blackboard etc. I was given some Photoshop Files which were easily translated to XHTML. The layout was already approved by the client so this step was pretty much a no-brainer.

I always wanted to try out the Drupal CMS and figured this Intranet-Site would be a perfect fit for it. Drupal was developed with community sites in mind; every aspect of it was designed support the extensive built in User and Rights management. Just what I needed.

My XHTML file was quickly adjusted to function as a Drupal template. Not everything was working right from the beginning, but I figured I’d first work out the hard stuff and care about these “small rendering bugs” later. So I carried on to build my content – which is where my odyssey started.

In the Module Maze

Drupal heavily relies on modules. Figuring out what you want to do is one thing, finding the right modules to do it with is quite another. Between the nearly 3000 available modules I stumbled over something which seems to be almost a standard (correct me if I’m wrong) for all Drupal sites: CCK, the Content Construction Kit. With it, you can click together new content types without touching any code. Sounds promising. About 30 minutes and a dozen installed modules later, I found myself with a working calendar which accepts dates from my newly created event content type. Not too bad.

The visuals of the calendar of course didn’t exactly fit the rest of the site. No problem I thought and searched for the calendar template… which I didn’t find. All of its HTML code is echoed directly from within a PHP file (oddly disguised with a .theme extension) just like in the good old 1990s. There was however a CSS file with some 50odd classes to have fun with, which is good but not always enough.

Delicious Breadcrumbs?

My real problems however started, when I tried to get the breadcrumbs menu working. There are numerous ways to organize your pages within Drupal – the most important one being the taxonomy system – which I head to read 4 articles about, stuffed with words like vocabularies and terms, to finally figure out what exactly it is. One got it straight: The taxonomy system works like categories, only that pages can be assigned to multiple categories instead of just one. Thank you.

This taxonomy thing sounds flexible, but also renders breadcrumbs basically unusable. What is the correct breadcrumb path of an article residing in the A/B/C and the D/E/F category? Of course, there are again dozens of modules “fixing” this problem with which you can, for instance, enter the complete breadcrumb path for each node you create. Wait, why am I using a CMS again?

I had similar problems when building the menu structure – the menu items didn’t highlight when you’re in the corresponding category, only the submenu items did. Also, defining which menu to display at which location was tedious. Maybe I was just missing something…

And the answer was so near

After two more hours of searching and reading, I finally gave up and built the page with my own CMS. I quickly wrote the missing pieces (like a calendar) myself and finished the page in just a few hours. This of course is an unfair comparison, because I know my CMS in and out, which is exactly my point! Drupal isn’t bad – it can do many things quite well. Drupal isn’t easy – there’s lots and lots of stuff to learn and understand to build a page with Drupal as you intended to. Drupal also is complex – if you want to do something it isn’t built for, you have to know quite a lot about its inner workings.

Don’t underestimate the cost of learning a new system. I’m not saying you should go through this world blindfolded. However, especially on time critical projects, it is in most cases better to go with something you know well and program the pieces you need yourself, instead of having to learn a new library, framework or CMS. Don’t “reinvent the wheel”, just build one to perfectly fit your vehicle.

Wednesday, February 13th 2008
Tags: Random Thoughts, Web Technology

12 Comments:

#1: Jo – Thursday, February 14th 2008, 22:43

Interesting post with a very strong last sentence.
I enjoyed reading!

#2: Julian – Wednesday, March 26th 2008, 01:36

Nice article. We have just gone through the same thing. After 4 years of working with our own hand rolled CMS, we had to do some work for a client in Drupal. It is not terrible, but man is there a lot of extra stuff sprinkled everywhere.

#3: Ben Reubenstein – Wednesday, March 26th 2008, 17:27

Loved this write up as I just had a very similarly frustrating experience with Drupal.

#4: Motin – Thursday, April 3rd 2008, 22:14

The trick is to start off learning Drupal in and out. This way it will basically become "your" CMS (since it's everyones to share and contribute to), and for all future projects you'll do things much more efficient than if you rolled your own CMS.

I do agree however that Drupal is overkill for the smaller projects like you described! It comes in handy when your customer requests different user access levels with premium memberships that should be payed for by creditcard on site etc.

#5: Micecreations – Sunday, June 8th 2008, 01:24

Yeah, i totally agree with you... I'm developping a website for an univrsity project with Typo3... I totally lose my time to try to understand how works this CMS (oh my god, i love so much CushyCMS :p) even if my teachers tell me Typo3 is a really good CMS

#6: MOin – Wednesday, September 24th 2008, 20:43

When i first started blogging i tried so many CMS's and found my head is spinning like disc and found too many which i really liked but so many consequences with different things. at the very end of my search i liked 3 of them Wordpress, Joomla and Pagenode because of functionality and integration with many other applications. frankly speaking i did't liked drupal it was enough complicated for an intermediate user who just want to start a website for fun purpose. am not here to critisizing but to share my experience =)

#7: Ed – Tuesday, September 30th 2008, 12:28

Drupal is awesome and is by far the best CMS system out there. Yes its hard to learn but once you do you can create anything you can think of. I have worked on huge projects using Drupal and the flexibility it can give me to fit anything to the clients needs is there you just need to understand how.

#8: JB Design and Photo – Thursday, November 6th 2008, 03:36

This is definitely most everyone's first experience with a cms like Drupal, there are just so many things going on that you get overwhelmed. I'm in the process of converting my site to Drupal and it's a royal pain, but all of the modules and addons are making it easier to add the functionality I want without rolling my own.

#9: mths – Friday, February 13th 2009, 12:42

I totally get your frustration but your last lines sum it up nicely. Learn first, then make. To put together a quicky with a system you never used yet is extensive is a sure disappointment.

To the point, I agree with your breadcrumb problem. I don't know how to solve it either. The menu placement? I don't see the problem. The menu structure? Each active (sub)menu item has a class 'active', its parent has a class 'active-trail' so it's just a matter of css-theming.

#10: bryan – Saturday, February 13th 2010, 00:08

I'm currently working with Drupal daily, am extremely efficient at creating modules and I understand the core.

I still think it sucks. I think it's overkill. I think a large majority of the problem resides in the fact that Drupal is abstracted in such a way that it can do anything, and everything -- but that doesn't come without a cost.

Spending 4 hours Googling something like "How do I put breadcrumbs in a separate template?" Oh, preprocess functions. Okay, "How do I use preprocess functions to make..." and on and on it goes then you realize there's a module for it, or something ridiculous. It just feels like a stack of cards to me not to mention the ridiculous database dependency it has. I had to install memcache, APC and tweak the crap out of Apache + MySQL for a day or so just to get it to steadily serve 50-100 active users.

I've made my own CMS using CodeIgniter as an integral starting place and recreated the same exact project in 3 weeks as opposed to 3 months.

I don't hate drupal, I see it's usefulness in plain view -- it's just overly complicated for what it accomplishes.

#11: mike – Monday, June 7th 2010, 14:38

you always compare your lack of drupal knwoledge (because you only used it for a couple of days) with the long term experience you have in another system. WTF?

#12: Stephan – Wednesday, August 25th 2010, 18:16

Drupal has a steep learning curve, which is the price you pay for power and flexibility. It doesn't help itself by using a myriad of its own terminology, with a number of naming clashes and inconsistencies, but once you get around that and build up a pool of favoured modules (community and custom) you find you can do a lot very quickly.

Be sure to carefully review any modules you use, because as contributions from the community many don't do what they say on the box (be extra careful with those related to security and privacy!). Much functionality can be achieved using the core with CCK and Views, so I'd achieve as much as you can with those before installing modules, as the maintenance overhead obviously grows the more modules you rely on.

For the breadcrumbs, I find that a menu based approach is better, whereby the breadcrumbs reflect the menu hierarchy. Use the Menu Breadcrumb module for this: drupal.org/project/menu_breadcrumb

Post a Comment:

Comment: (Required)

(use <code> tags for preformatted text; URLs are recognized automatically)

Name: (Required)

URL:

Please type phoboslab into the following input field or enable Javascript. This is an anti-spam measure. Sorry for the inconvenience.