Home Classroom Drupal An insight into the world of Drupal – Part 1

An insight into the world of Drupal – Part 1

1278

In the world of IT convenience is a major factor that drives the progress. Content Management Systems (CMS) such as Drupal, Joomla, WordPress or MODx are prime examples for this. Throughout this article series we’d be looking at how to use the all purpose CMS-Drupal  to our advantage.

 

Logos from WordPress, Joomla and Drupal

 

By the definition CMS is a computer application used to create, edit and manage various kinds of digital medial and text. There are many variations with CMSs but some common characteristics such as login and user management facilities can be identified as well. Most of the times CMSs are created with the intention of a particular audience or a set of tasks. For example the main audience of WordPress is the crowd of blogsphere and it has become the de facto CMS for a simple (or may be not that simple with recent upgrades) blog now. But few CMSs such as Drupal and Joomla are designed in a way that suits all purpose and all audiences. Also CMSs can be futher categorized based on their commercial background. Drupal as well as Joomla and WordPress are several Open-Source content management systems that are currently in wide use. There are also many popular commercial CMS platforms such as ExpressionEngine that provide their service at a cost.

As most of successful open source projects, the vast community that’s around Drupal is what gives it the power to be a leading CMS in the open source arena. As of recent stats it has a member base of more than 350,000 and a developer base of more than 2000. According to Drupal download stats, within the year May 2007 to April 2008 alone it has recorded more 1.4 million downloads which is a 125% growth from year 2007. This exponential growth also means the rapid growth of the community as a whole. Among few notable sites that have used Drupal as its CMS platform are NASA, FedEx, MTV UK and Ubuntu(many other popular Drupal based sites are listed here at http://buytaert.net/tag/drupal-sites). Also Drupal won the awards for best PHP based CMS and Overall Open Source CMS which were the most tightly contested categories at CMS awards 2008.

 

Mementos from CMS Awards ’08

The Drupal project started as a message board by Dries Buytaert and became an open source project under GNU Public License (GPL). Dries wanted first to name the site as ‘Dorp’ which in Dutch means village which in turn meant to refer the community around it but later it was changed to Drupal because it sounded better. Drupal is an English rendering of the Dutch word ‘Druppel’ which gives the meaning ‘drop’ and the current Drupal logo is depicting it as a water drop.

So that now we have taken the first steps toward Drupal let’s get down to real work.

The ways of Drupal

Drupal is not just a Content Management System, but also a modeler frame work. The invincibility of Drupal that makes it a possible solution to all situations comes from the way it’s organized. This modular framework allows it to be extended and to add new features through modules or change the  complete look and feel through themes without a drop of sweat.

When we consider the structure of a Drupal site, we can break it into two major parts which are,

  1. Modules
  2. Themes

So now let’s skim through modules and themes of Drupal with the intent of diving deeply into them at a later time.

 

The power of modules

Most the functionality of Drupal is rendered through its modules set. There is a set of core modules that comes with Drupal that handle all the basic tasks of the CMS such as login and user management, error logging and other essential system tasks. Other than these core module, there’s also a set of optional core modules that comes with the installation for various tasks such as RSS aggregation, handling user profiles and managing user comments though unlike core modules they are not mandatory for running the system. For extra functionality users can download suitable modules freely from the vast modules repository at http://drupal.org/project/Modulesor create your own modules to achieve the desired functionality (which we will look thoroughly at a later time).

Hooks can be considered as the most distinctive characteristic of Drupal module architecture. The concept of hooks is mainly to allow modules to interact with the Drupal core. To extend Drupal, a module needs simply to implement the appropriate hook from the defined set of hooks (to get the full list of hooks for Drupal 5 see http://api.drupal.org/api/group/hooks/5). When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and call that hook in all enabled modules that implement it.

Blocks are also another major component of modules that worthy taking a peek into. Even though it’s not mandatory for a module to have a block, most of modules that represent something visually have blocks. Blocks are separated, customizable areas of the web site that can be moved to various positions of the site with just a few clicks from the back end, which in turn makes it so unbelievably flexible and customizable. For example the login box in Drupal is a block that’s implemented in the core User module which provides basic login functionality. Even though by default it’s in the side bar of a page, with just a small change from the back end to the position of the block, it can be moved to any position of the page (or any where a region -a defined boundary in the site that a block can be displayed- is defined). With each module having the capability of creating as much as blocks necessary, it makes modules even more flexible and powerful.

 

Drupal module administration page

 

The beauty of Drupal themes

A Drupal ‘theme’ is a collection of files that makes the presentation layer of the site or in other words defines the “look and feel” of the site. It contains the underlying hierarchical page structure which decides the order of how a page should be properly overlapped and rendered, the the cascading style sheets (CSS) files that controls the presentation and even javascript files that are used for dynamic page content.

The best and most noticeable feature of a Drupal theme is it’s abstraction and hierarchical order. The order of a theme usually comes in the bottom-up incrementing way such that it can control the presentation of almost everything of the site. For example the default presentation of a button that’s defined in a block can be easily changed through overriding the appropriate default element template in your theme. Now if you want to change the look of this block, it can be done by defining a block template for that particular block. Then if you still need to change the look of all blocks as a whole you can override the default block template. But this hierarchy is not only limited to visible regions of the site such as blocks; it can also separately customize deferent content types of the site. Also you can define a template for the front page and another for repeating mundane middle pages. Now you might see what I meant when you can change almost everything of a site with the help of Drupal theming hierarchy.

As a side note. a basic knowledge of PHP could be a help for some tasks, but even without it you will still be able to do a good theme if your theme is not much complicated and does not override the default behaviour. Drupal comes with a few built in themes and for more themes you can use the repository at http://drupal.org/project/Themes to see any matching theme to your requirements or at least a close resemblance that can be customized without building from the scratch.

 

 

A word about versioning

A new user to Drupal can get bit dazzled by various Drupal versions out there. There are still 4 versions going around ranging from Drupal version 4 to 7. Even though it has been over a year since Drupal 6 has been released, Drupal 5 is still seems at the forefront with the compatibility of  modules. Further, as of now Drupa 4 is on it’s way to getting extinct while Drupal 7 is still too unstable and not supported by other modules for any practical purpose.

To get any of above Drupal versions use the URL http://drupal.org/project/Drupal+project.

 

Enough Chit-Chat

So now we know the basics and the background of Drupal let’s setup a Drupal site in your localhost. For this you only require a web server (apache, IIS .etc) with PHP enabled and also a Database management system such as MySQL or PostgreSQL installed.

Getting a Drupal site set up is easier than a piece of cake. Here are the simple steps that you have to follow.

  1. Decide which Drupal version you are going to use and download it from above address.
  2. Unzip the download package and put it in your web server document root.
  3. Create a new database (you can use a tool like phpMyAdmin or just terminal for this) and enter the database name and database logins to Drupal installation page
  4. Click next and Drupal will set up itself.
  5. Now you can goto the Drupal administrator account for the first time and add logins to your super administrator account and submit.
  6. That’s all, you are ready. It wasn’t hard, was it ?

 

Like to give a hand ?

Drupal community has created and maintained this wonderful and unbelievably useful CMS with their hard working. So while you are using this amazing CMS, do you feel like giving a hand ? You won’t have to be able to code; You can contribute by writing some documentation or testing and reporting few bugs in the plethora of modules available there. Also you can join live discussions at IRC #drupal, #drupal-themes, #drupal-dev or #drupal-support at Freenode for more deeper subjects. All your support will be enough to improve at least a tiny bit of the project which in turn will help many others in the long run.

Comments

comments

Laknath Buddhika is an old Royalist and currently doing undergraduate studies at Faculty of IT, University of Moratuwa. He has worked on various fields of IT for more than a decade and is currently employed at Vesess Pvt Ltd for more than 2 years. He is an avid enthusiast of Open Source and has participated in Google Summer of code programme twice(2007,2008) representing Open Source organizations Gnome, Eclipse and also a member and a module contributor for Drupal community. He has a keen interest in the PHP language and PHP based CMSs such as Drupal, WordPress and Frameworks like CakePHP and CodeIgniter. He is also employed at DMS Pvt Ltd as a part-time PHP lecturer and wishes to spread PHP and the idea of Open Source throughout the Sri Lankan society.

NO COMMENTS

Leave a Reply