Modules

Keywords: 

Drupal does a lot, straight out of the box. You can make good Web sites, and other types of IS.

Drupal won’t do everything you want, though. What do you do then?

Install a module. A module is code that you plug in to Drupal to add extra features.

Embedding videos, again

Earlier, you learned how to embed videos in a page by editing the HTML. Is there an easier way?

Why, yes. Yes, there is. There’s a module that will let you add a video embed button to the editor toolbar. This is what the toolbar looks like normally, with the Full HTML text format:

Editor

Let’s add a button that can insert videos, without messing with HTML:

New button

Finding modules

You can find modules on Drupal.org (D.O). The complete list is at https://www.drupal.org/project/project_module. There are thousands of modules, so you can find one for most needs.

Installing modules

We’re going to install the CKEditor Media Embed Plugin.

Project page

Every module is packaged as one file. There’s a link to the file at the bottom of the project page. You could download the file to your computer, and then upload it to your Web server. There’s an easier way, however. Easy is good.

First, copy the URL of the module file onto the clipboard. To do that, right-click on the link to the file, and:

Module file

The command is called something different on different browsers. In Firefox, it’s Copy link location. In Chrome, it’s Copy link address. In Internet Explorer, it’s Copy shortcut.

(At the time of writing, the module wasn’t quite finished, hence the -dev on the end of the version.)

On your site, go to Extend in the admin menu, and click on Install new module. Paste the URL of the module file:

Paste URL

Click Install. Drupal will download the file, and install it onto your server.

Now enable the module. Go to Extend in the admin menu, find the module, enable, and save.

Enable

Configuring modules

Some modules you just enable, and that’s it. Others you need to configure. The module we just installed is one of the latter. It creates an “Embed media” button, but we need to tell Drupal where to put the button.

Let’s add the button to the Full HTML text format. Configuration | Content authoring | Text formats and editors. Click Full HTML. Scroll down a bit, and you’ll see the toolbar configuration. Before we installed the module, here was the config:

Toolbar before the module

The module adds two new buttons to the Available buttons:

New buttons

Both of them embed videos, in slightly different ways. I used the button on the right, but you can use either.

Drag the button to where you want it in the Active toolbar. Then save. Now, when you use the Full HTML text format, the button will be available:

New button

Using the new feature

Find a YouTube video you want, and copy its URL:

Copy URL

Go back to your Drupal site, and click the new button. A box will pop up. Paste in the URL. That’s it!

Exercise: Install a new module
Install the Share Buttons module. It creates a new type of block.

Add a block of social media share buttons in a sidebar on your site. It should be on every page, and visible to all users.

Submit the URL of your site.

(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)

Summary

A module is code that you plug in to Drupal to add extra features. Download modules from Drupal.org. Some modules you just enable, and that’s it. Others you need to configure.