Category Archives: drupal

Drupal in perspective

Drupal prides itself on its community aspect. And so it should as a truly open source system. One of the good things to come out of this is the principle that dissenting voices should be given a platform. Hopefully what they say gets taken on board too. A talk titled ‘Why I hate Drupal’ at the recent DrupalCon in DC is a great example of this principle.

‘Why I hate Drupal’ was given by James Walker, one of the Lullabot team, and general Drupal insider and guru. It’s important to point out that this isn’t just some bile-filled sour-grapes rant. It’s a considered, insightful and eloquent discussion of some of the problems and issues with Drupal as it grows in popularity, and enters a new, more mature phase of its life.

Here’s a link to a video taken of the talk. It’s an hour long, so you may have to book out some time to watch it. It’s worth it though.

http://dc2009.drupalcon.org/session/why-i-hate-drupal

Pro Drupal Development 2nd Edition by John K. VanDyk

Pro Drupal DevelopmentIf you want to get at all serious about taking Drupal beyond a simple installation, Pro Drupal Development is going to be a massive help to you. If you’re anything like me you’ll come back to it again and again for reference and to try out some new ideas. 

It covers all kinds of development areas such as building your own modules, the form API, themes, and even best practices. All this kind of stuff can be found online, but it’s a big help to have it all clearly explained in one place. Sometimes you just need someone to guide you through the maze of options that Drupal offers. 

Much of the book isn’t for the faint-hearted. You need a good working knowledge of PHP and some MySQL. Most books start you off nice and easy, but here the early chapters are very much a leap into the deep-end. There’s a certain amount of reliance on just accepting fairly esoteric Drupal stuff until it’s explained more clearly later in the book. 

The book also comes with plenty of examples, which you can download for free from Apress. These really help you get your head around some of the trickier ideas (I found one or two of the examples didn’t work as described – but to be fair there are some errata by the author on the Apress site). 

In summary – this book is an excellent buy if you want to take Drupal to the next level but don’t know where to start.

Using Drupal by Angela Byron

Using DrupalUsing Drupal is a great little book if you’re just starting out with Drupal, and want to know which modules could be useful for you. If you’re getting into true development stuff and want to play around with Drupal a bit more, the excellent Pro Drupal Development by John VanDyk would be a much better choice.

This book was written by members of the Lullabot team, who do Drupal consulting and development work. They really know their stuff, so you feel things they suggest in this book (like choosing module x over module y) are worth listening to.

The book itself guides you through typical scenarios you might want out of a Drupal website, like wikis, a shopping cart, workflow, multilingual sites, etc, etc. Each section has some useful tips and ideas, but doesn’t go into a massive amount of depth. So again, great if you’re just starting out and want a flavour of what’s possible.

Drupal Enterprise how-to

In a couple of earlier posts I mentioned how I thought Drupal could be used as an enterprise-level CMS, at least if you were willing to change modify your definition of ‘enterprise-level’ slightly.

When thinking about deploying any CMS across a large organisation or large company, one of the things you’re going to find is that you need two key things:

  1. separate departments will want separate sites that they can control the content of, and maybe even the look-and-feel of
  2. content from all those departments will need to be aggregated in some way, and reused by other departments

It’s these requirements that enterprise-level CMS cater for really well. It’s these that Drupal can only partially answer. This is why Drupal isn’t really completely enterprise ready, yet.

However it can go a long way towards that using its little-known but powerful multi-site capability. There are plenty of blogs detailing how you can do this in any number of ways, so I won’t go into details here.

Take a look at some of my delicious bookmarks for things I found really helpful in setting up a multi-site system.

Basically, the idea is that each site in your multi-site setup has its own folder in Drupal’s sites/ folder. Something like www.mydomain.com.site1 would do. Now you have one Drupal installation, but the potential for lots of separate drupal sites.

While that does cater for a really simple single codebase setup, it doesn’t let you share things like users and logins. That’s going to be crucial for any true multisite setup, because you’ll want the same user to be able to go to different parts of your overall website without having to log in to each separately.

Luckily, Drupal has a really elegant solution to this. You can easily share tables across sites using Drupal’s database prefix system. So for example you could say that site1 will have its own tables prefixed with site1_ except it will use the user table of site2 (identified by site2_) for its user data.

This is all set in each site’s settings.php file, and requires just a few lines of code to do. Simple.

And with that, you open up a whole new world of multiple sites with single signons: the first step to an enterprise-level solution.

OK, so you don’t have truly shared content across sites yet. You may never have that, but then you may never need that. RSS feeds, simple RESTful APIs… there are all sorts of other ways of sharing content. You could even get adventurous and write your own module that treats some kinds of content types differently, putting them in shared tables rather than a site’s own set of tables.

Hooked into Drupal

In my last blog I mentioned how Drupal really does seem to offer more than just the ability to get a simple site up and running quickly.

Framework

When you look at Drupal more closely you realise one key thing: it’s not really a CMS, it’s a framework. Granted, nothing quite like Symfony in terms of its level of sophistication, but a framework nonetheless. Even a fairly modest PHP developer can therefore take what’s there and build on it in quite surprising ways. The vast array of Drupal modules is testament to that.

Hooks

That’s what makes Drupal so alluring as a CMS. It’s founded on a system of hooks: naming conventions which ensure that pieces of code you write will get called in certain pre-defined situations.

The simplest example of a hook is the menu hook. If you build your own module, all you need do is put a function in it called mymodule_menu and whatever code you put in that function will get called each time the core code builds the main site menu.

The real elegance of the system is that almost everything is built from hooks. Even stuff which looks like it’s part of the core code, like user management. Well, that’s actually a module built up using hooks. If you want to build your own slightly different user module, you don’t need to change the existing one. Just copy it, taking out the bits you need, adding in your own bits. Before you know it, you’ve got your own custom user module.

Community

The learning curve can be a little daunting at first, assuming you want to get your hands dirty with some module coding. Luckily, there are loads of excellent books (I can definitely recommend Pro Drupal Development by John VanDyk), web pages, blogs, etc around to help. Just google them, they’re out there! That’s another great strength of Drupal: the community. No matter how stuck you are, how bad things look. Chances are there’s someone out there who’s been in exactly your situation and come out the other end.

Drupal as an enterprise CMS?

 

drupal

I’ve been looking a lot recently at Drupal not just as an open source CMS, but as a viable enterprise level CMS. Despite my earlier misgivings I think Drupal has a lot going for it, and it may be that over the next couple of years it will become a much bigger force in the world of content management.

Months of searching for a really good open source CMS had never really come up with anything that would meet my needs:

 

  1. free/cheap
  2. really easy for people to create and edit content
  3. great support, or at least a great user community I could turn to
  4. highly extendable by someone with sufficient coding expertise
  5. able to cope with lots of separate – but related – sites from just one installation

My first thought was Drupal. So simple, so lovely… but… but that’s just for small companies and society websites, right? OK, next!

Then I found MySource Matrix (developed by Squiz, an Australian company) which did everything except point 2 (and sort of failed on points 3 and 4, but that’s another story). Then I found Alfresco, which is really a document management system. As you’d expect, it did everything except point 2 because for it, web pages are just another form of document.

I was running out of ideas. But actually, after I was forced to think about the total lack of open source enterprise CMS, I started to wonder whether I really needed all 5 of the above. Maybe I just needed the first 4, and having a massively integrated multi-site system is something which I could live without.

Hoorah! Epiphany! Yes, Drupal does do everything I want. As soon as you start to realise that, Drupal seems to fit the bill perfectly.

Even better, the more I looked at multi-site capabilities, the more I saw how Drupal does allow for this, albeit in a somewhat limited way compared with the really big, expensive commercial CMS. Don’t believe people when they say that Drupal can only do small sites. It can do far more than that. With a little imagination and tinkering around it can actually do a vast amount.

Delving deeper… I saw that there are now companies offering enterprise level SLAs for Drupal. Specifically, I found Acquia. It’s a company set up by the founder of Drupal himself – Dries Buytaert – to offer the kind of hand-holding that’s put people off Drupal in the past. OK, it’s a very new company with no track record. But the signs are good.

I think the moral to this story is: make sure you know what you’re looking for from a CMS. Don’t just assume you need the most expensive powerful beast out there. Don’t even assume you need something that fits in exactly with your organisational needs. Chances are that in most situations, your needs aren’t quite so written in stone as you might think.