Learning “How to Drupal”

Learning “How to Drupal”

I’ve noticed a growing number of DrupalSN users signing up because they want to learn “how to Drupal” and as many of you are probably finding it can be a steep learning curve!

So in this tutorial I’m going to highlight some important points and resources you should check out if you’re just starting out with Drupal.

Understanding Drupal versions
Drupal versions can be alittle confusing when you start out. Questions like “which version should I used?”, “Which modules can I use with which version of Drupal?” are common.

Drupal Core
The Drupal project (the core files) is in constant development and when a development version is considered stable enough for production or bugs are found in a previous version the new version is officially released for everyone to download.

For bug fixes the version bug-fix number (after the .) is just incremented by one.
For example Drupal 6.8 becomes Drupal 6.9.

If the version to be released is significantly different (new functions and functionality added) to the previous a complete new major version number is adopted.
For example the current latest major version of Drupal is Drupal 6 bug fix release 9 (Drupal 6.9), the next major release with be called Drupal 7.0, but inbetween we may have numerous bug fix releases so may end up with Drupal 6.14 for example.

Which version should I use?
In short use the latest stable Drupal version, but before you do so check in the Drupal.org module repository that the modules you want you use are available for the latest version of Drupal, sometimes modules take time to be updated.

If the modules you want to use aren’t yet updated you can either wait until they are (if you can) or use the next stable Drupal version down.
ie. If you want to use Drupal 6 but modules you want aren’t available yet then use Drupal 5.

Most modules are generally updated when a new Drupal version is released (although it can take time) but it’s worth looking on the module project pages as developers will normally tell you if they don’t plan to upgrade and they normally offer a link to an alternative module.

Why do we have Drupal 4.6, 4.7, 5.14…and Drupal 6
Drupal 4.6, 4.7 and 5 are all previous versions of Drupal core.
The Drupal project offers support (in terms of bug fixes) for one version back from the current version. So at present the current major release is Drupal 6 but bug fixes are still provided for Drupal 5.

Which modules can I use with which Drupal version
Fortunately Drupal.org helps you a lot here (see screengrab below) by suggesting which module version is best for which version of Drupal. You should follow this unless the module project description says otherwise.

Module Releases
Basically you need to match the core Drupal version you are using with the module release version. So if you are using Drupal 6 you need to use the Drupal 6 version of modules, simple.
The development snapshot is used for testing and should not be used on production sites unless the module description says it is safe to use.
*Note not all modules support all versions of Drupal.

Find out more about Drupal version numbering.

Installing Drupal
As of Drupal 5 installing Drupal was made a lot easier so this shouldn’t really cause any major roadblocks.
There’s a great section on Installing Drupal over at drupal.org so I’m not going to repeat what has already been done, but I will quickly go over what you’ll need:

Web hosting or localhost setup with PHP and mySQL
A reliable host company that supports PHP (preferably PHP 5 or higher) and mySQL is essential.
I’d recommend cari.net (who host DrupalSN.com) or BlueHost, both offer great value and reliable support.

A lot Drupal functionality in the future will be making use of functionality available in PHP 5, so it’s worth checking with which ever host you choose that they support PHP 5. See this article about Drupal and PHP 5 for more information.

If you just want to test Drupal out and don’t want to spend money on a hosting company just yet then you can install Apache and PHP locally on your own computer and have your computer act like a web server.
I’d highly recommend WAMP server for Windows and XAMP for Mac.
See this article on installing Drupal locally for more information.

An FTP client to upload to your hosting
You don’t need this if you are are only working locally on your computer.
There are many free FTP clients out there and a simple Google search for FTP clients will bring you a whole range of FTP clients. I use and recommend Fire FTP for Mozilla Firefox.

Common errors and issues
As I said Drupal is now really easy to install but here are a few common issues people encounter:

White screen (of death) problem
This often happens on the module admin page when your PHP setup runs out of memory. Drupal does use quite a lot of PHP memory so you’ll need as much memory as you can get (many hosts limit it to save on resources).
Here’s a good article on the white screen of death error and Drupal.

Clean URLs won’t work
Clean URLs set up is explained well in this article so check it out if you are having problems.

Here’s a selection of articles on troubleshooting your Drupal installation.

Installing modules and themes
Drupal offers 2000 plus add-on modules and numerous add-on Drupal themes so you have many options for customising your Drupal site.
Installing contrib modules and themes can be tricky to start with but it’s something well worth learning.
Something to consider is the more modules you install, the more resource that Drupal requires, and this may slow your Drupal site down so keep an eye on the number of modules you install.

I’ve covered installing Drupal modules and themes in another article so take a look to find out more.

You might also want to check out DrupalModules.com for module reviews and ratings or find out what modules are used on DrupalSN.com.

Understand the node system
Content in Drupal is know as “nodes” and the node system in Drupal is well established and easily expanded (adding new fields and content types) by using the Content Construction Kit (CCK) module(s).

For each item of content on your site you create a new content or node type, although some modules have premade content types (ie. forum or page nodes).
For example, say you want to create a news system you would use CCK to create a new content type called “news” and then you can add any fields (Drupal by default creates a title and body field for each content types) you like to that node type like “news photo” or “external links”.

The node system can be the backbone to any Drupal site (all content on DrupalSN is create this way) and you can also use the Drupal views module to display lists or “views” of content (ie. the DrupalSN tutorials list).

Find out more about Drupal content types on Drupal.org.

Understand the theme layer
Like the Drupal node system the Drupal theme layer is well established and relatively easy to expand or override.
Throughout the Drupal system Drupal modules make calls to “theme” functions which take a particular piece of data and outputs it as HTML.
What’s great about this is any “theme” function in Drupal can be overriden by your theme so you have the ability to override the way a module outputs HTML without needing to touch the core Drupal files. Throughout DrupalSN.com I make use of the ability to override theme functions and output HTML as I want.

A good knowledge of HTML and CSS is really useful when adapting your theme, but don’t be put off if you’re not a PHP expert, you only need to deal with small PHP snippets which in most cases you can copy and paste from other themes like the core Garland theme.

Find out more on theme function overriding in this DrupalSN article or here on Drupal.org.

Useful modules
As I said there are over 2000 Drupal modules available for you to download and install. Here are some of the most useful you might want to check out:

CCK / Views / imagecache / pathauto
These modules allow you to make rich content types and display them in nice content lists.
The pathauto module is great for getting site into search engines as it creates human-readable URLs like “articles/how-to-use-drupal”.

Admin Menu
This module is great for admining your Drupal site.
The module creates a snapshot of your site navigation and turns it into an atrractive and convenient set of drop down menus that stick to the top of your screen. This means you can browse the admin pages quickly and admin your in less clicks.

This module lets you attach images to your content via textareas and also plugs into a number of rich text editors.

This module lets you alter the HTML output that the node system produces for your content types all through an admin area.

Update Status
Another great admin module which regularly pings the Drupal.org server to check that your Drupal core and modules are up-to-date, so you never miss an important security release of Drupal or a module.

The list could go on forever so here are some links to useful module suggestions from other sites:

Make your first Drupal site
I found a great way to learn Drupal is to set yourself a personal projects (like a porfolio or hobby site) and build your site out from there.
Often just reading through documentations can become boring and it’s alot better to get your hands dirty and get stuck in.
Remember everytime you hit an issue or problem that it might be a pain but you are learning all the all.
One of my first Drupal projects was AdrenalineHub.com and it definitely accelerated my “Drupal learning” and you’ll learn numerous lessons you can transfer to future sites.
Biggest thing I learnt early on is DO NOT EDIT CORE FILES it makes future upgrades very tricky indeed, in the long run you are far better off creating a module that plugs into Drupal (remember you can transfer module to any of your future sites).

Your first module
You will probably reach a point as your site(s) progresses where there isn’t a module available to do the job you want and this is when you’ll want to create a custom module.
Don’t be put off here, as I said above about theming you can often create a module by copy and pasting code from other modules, that’s what Drupals’ Opensource licence lets you do, although it’s always nice to credit people if you have borrowed any of their Drupal code.

I also found making Drupal modules really helped my PHP skills to progess as the Drupal coding standards you should follow require you to write well formed PHP code.

Also remember the way Drupals’ module system works means that any modules you make can be transfered to any future sites you create.

Once you are a “module-making wizard” you may want to contribute back to the Drupal project by getting a CVS account and submitting your module to the Drupal.org module repository. It’s a great way of saying thanks to Drupal!

Everyone I’ve introduced to Drupal in the past now can’t believed they used to make site without Drupal and I have to say I’m exactly same, think it’s been 2 years since I made my last non-Drupal site and I can’t see that change anytime soon!
My point is, the “Drupal learning curve” can be a long and sometime frustrating process but trust me it’s well worth it in the long run.

Here’s a nice introduction to Drupal video:

Leave a Reply

Your email address will not be published. Required fields are marked *