Drupal modules & themes
One of the reasons the Drupal is so popular is its extensibility. There are thousands of add on modules and themes for Drupal. In this video we are going to show you how to tap into this power by looking at how you find and install these add-ons. The Drupal project is a giant duo-cracy that rewards execution from people based on their talents and initiatives. The project is balanced into two branches: Core and Contrib, each with their own style of governance.
Core is all the files that you get with the main download of Drupal. More than thousand people have contributed to Core through code, patches, test, and various other artifacts. However, for something to make it into the main package, it must be approved by a small number of maintainers. In this way Core is fairly controlled. No significant feature changes happen from one major release to another, just bug fixes and maybe some minor tweaks.
Contrib is another story. This is where anyone can potentially contribute their concepts to the project. Thousands of developers have written thousands of modules, themes instillation profiles, and translations. Drupal is really a competition of ideas.
People have thoughts on how to make Drupal better, and write those concepts into project like modules. There is a saying in the Drupal community: "There is a module for that." One of the best features of Drupal is that if you have a need for something on your website, the odds are that somebody else has had the same need. If there is a common set of needs, someone has most likely written a module to help out. One of the challenges of Drupal is not a lack of functionality, but that things can often be done multiple different ways & can manifest themselves in multiple similar modules. At that point, it is left to the site builder to understand the nuances and select the best way. The good thing is that there are some indicators to help you select the best modules.
Over time, the community tends to converge on a collective; this means that over time, the best ideas tend to bubble to the top. If any of those ideas become central to Drupal, they might even get into a future version of Core. Much of the differences between Drupal 7 and Drupal 6 are that some of the best contributed modules have been moved into Core in Drupal 7.
To review the modules currently uploaded to our site, we can go to the modules link on our tool bar. What we are seeing here is a list of modules whose files reside on our sites directories. We can also add to this list by saving additional module files within our installation. Since this is a fresh install, the modules in here are the ones from Core. To enable and disable modules we use these check boxes. Notice that the default installation does not enable all modules.
Also notice that there are helper links that give us quick access to related settings and helpful information. To search for additional modules to install, simply go to Drupal.org and click on Download & Extend. These four links over here gives us access to Drupal's Contrib projects:
- Modules are things that extend the functionality of Drupal.
- Themes set the look of the website.
- Translations allow you to do work in different languages.
- Installation profiles are really sort of a preset Drupal in a box for different styles of websites.
Right now we want to look at Modules so let's click on those. What we are seeing here is a list of Modules sorted by uses (viewed as the most used Contrib Module and so forth down the page). Drupal also gives us some tools to help us find modules in the form of a search box and several filters. However, much of the time you already know what module you want either from experience, talking to other developers, looking at case studies, reading blogs, or even watching tutorials.
Finding & Inspecting a Module
One of the modules that I like to use in all of my sites is the Backup and Migrate Module. So to find it, I am going to go ahead and search for it. I click search, and now I can scroll down my page. We see it's the second module on our list. Now I am just going to click through to the project page.
The product page tells us a lot about this module. There is a description, and there are several other key pieces of data we should look at. Lets go ahead and scroll down to the downloads area. Here we'll see that we have a steady release for Drupal 7. That's good. Sometimes you will see release candidates, beta, or even alpha statuses. And while generally released candidate and beta statuses are fairly stable, it's still good that this isn't a standard release status.
The other thing to note is that this has been around since Drupal 5. That's some longevity. If we look above the Downloads area we will see this project information. The first thing we want to look at is this development status. It's under active development. That's a check here. The next thing that we will notice is that the maintenance status is unknown. That's a little bit of a red flag but since this is a new feature of Drupal.org, not everyone has set it. I know it's a stable module, so I am not going to worry much about it. The next thing is we see the usage of this module. These are the number of sites that are reporting using this module. The one thing that you do have to do though is look at this number compared to other modules because an absolute number is not going to mean a whole lot.
The other number that we have that's pretty useful is that we can look at the historical usage statistics. If I scroll down I can see that this module is growing in popularity, so again that's a pretty good sign. One of the other tell tale signs of a quality module is it's issue queue. Drupal.org is actually a large project management system where people can submit issues and bugs on various different modules, and they show up in the issue queue. So a lot of times seeing the number of issues, and the types of issues can tell you a lot about the stability of a particular module.
Downloading a Module
Now that I have seen enough I have decided I want to download the Backup and Migrate module. To do that, I need to move it over to my site installation. So I am going to go to the Downloads area, and click on Copy Link Location. I am going to run back to my website, scroll up to the top of the modules area, and click on this Install New Module.
I simply paste my URL in here, and click Install. This is something actually new with Drupal 7 that we don't physically have to do administrative things like FTP or SSH to move files. The site can do it by itself. To see our new module we want to go back to the Module page. Click to home to reset the site, and then click again on Modules. Now I can scroll down and we can find the backup and migrate the module here at the bottom. To enable, I simple click this check box, Save and configure. If I want to use my new functionality, I simply go to configuration. Here I have got a new option, and I click on Backup and Migration. Following this, I come to an admin where I can backup my database and store things as I need to.
Let's look at installing themes. To manage themes, we go to the Appearance link underneath our administrative toolbar. Here we come to a page that is actually very similar to our modules page in that it allows us to enable and disable various themes. However, this one is more visually oriented because we want to look at what it is we are enabling. We'll see that Core gives us two themes that are enabled by default: Bartik and Seven. If we scroll down, we will see that there are actually two other themes that are currently disabled. We could enable them and start using them but we really don't want to work with Core themes. Let's go ahead and download something from Drupal.org.
Searching for Themes
To start our search for themes we go to Download & Extend, and this time we are going to click on the Themes tab. One thing I want to do is filter for only Drupal 7 compatible themes. So I am going to go ahead and select this, and do a search. Now we get our list of various different themes ordered by usage, and I can use these thumbnails to help me find something that I might like. I should note that there are two types of themes:
- Full standard themes - These are the types you want to use!
- Base themes - Really only used by web designers to help them create custom themes. They're not really going to give you what you want as far as doing it on an end user website.
I'm going to scroll down to a theme that I really like: Marinelli. To install this, I am going to:
- Scroll down and copy this link
- Go back to my website
- Go to Install New Theme
- Paste my link in here
- Click Install.
Now that our files are installed, let's go ahead and enable our theme. Click on Administration pages, reset the site, and click Appearance. When we scroll down we now see that our new theme is here, but it's not enabled. We just simply click this to enable it, and now I am going to close the overlay.
The site refreshes, and now we have a completely different theme on our sites. Very neat! The cool thing is that we can actually keep going back to Drupal.org, and installing as many themes as we want, and play around with them until we find something that we like.
Keeping Your Site Up-To-Date
The last thing we want to go over is keeping your site code up to date. Periodically, modules and themes have new releases. Even new versions of Core are released every now and then. New versions might have new features, bug fixes, or security patches which are pretty critical to update. Fortunately Drupal gives you tools to help keep your code up to the latest stable version.
If we want to check if anything needs updating, we can go to Reports, and then click on Available Updates. This report shows us the status of Core, and any other modules and themes that we may have enabled. Items in green are up to date, otherwise we are not on the latest recommended releases. Now I have gone ahead and intentionally installed an older version of the link module, and we can see it is highlighted in yellow letting us know that a new version is available.
If we had any modules that needed a critical security patch update, those items would be highlighted in red. Luckily, Drupal 7 gives us some tools to help us keep these modules up to date. Simply scroll to the top of this Report, and click on the Update tab. Now it's going to give us a list of any modules that need updating. So I am going to go ahead and click on the link module, and then click 'Download These Updates.' Now the new version has been transferred over to our local installation, but there is one last step. We need to update our database for whatever types of new data that particular module needs.
One of the things that Drupal is recommending is that we put our site into maintenance mode which is going to temporarily put up a maintenance page on our site, but it's going to protect our database so it's something we should do. You might want to do your updates in the middle of the night, or at some low traffic time just to help deal with that. I am going to click continue. It's now put us in maintenance mode. I am going to run our database updates, and now we are done. I am going to return to our Administration side, and we run back to our report for Available Updates, and we see that our module has been updated.
When you are first starting out with Drupal much of your time will be spend experimenting with modules. There are some great ones out there that are well worth the exploration. When I got started I found it very helpful to set up several sandboxes, and regularly set up backup points as I went along. Using the damp stack on your local computer with the Backup and Migrate Module is a great setup for exploring the power of Drupal modules.