18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 11 ■ <strong>Drupal</strong> Modules<br />

As you can see from these examples, there are thousands of modules that span a wide variety of<br />

categories. The general titles of the categories listed here often do not do justice to the rich features that<br />

are available in the modules that are buried beneath the titles. It often takes research and patience to scan<br />

through the hundreds of modules to find the one that provides the functionality that you need. Complex<br />

requirements may also take more than one module to provide the functionally you need to address a larger<br />

problem. Understanding which modules do what, which modules work well together, and which modules<br />

do not work together is often the hardest challenge of building a complex <strong>Drupal</strong> website.<br />

A recommended exercise is to visit www.drupal.org/project/project_module, select the “Last release”<br />

sort option for the “Sort by” field, and then click the Search button. The list displayed will show the latest<br />

modules and module updates that have been released to the community. Visit the site every day or two and<br />

read through the description of the newest modules that were added or updated on the site. It only takes a<br />

couple of minutes a day to quickly build up your understanding of the modules and types of solutions that<br />

are available through <strong>Drupal</strong>’s contributed modules.<br />

A great third-party website that helps solve the issue of finding the right modules is<br />

http://drupalmodules.com. This site provides a Search with Module Finder feature that makes it easier<br />

to look for and find the right module for the right job.<br />

Downloading and Installing a Module<br />

There are three basic approaches for installing a new module on your site: downloading the module files to<br />

your server, using the “Install new module” feature on the module administrative interface, or using Drush.<br />

I’ll cover the first two methods in this chapter and cover using Drush in Chapter 15.<br />

The first step in installing a module is finding the right module to use. As described in the previous<br />

section, there are thousands of modules to pick from; finding the right one is often the biggest challenge.<br />

For demonstration purposes, let’s pick two of the most popular and useful modules: the Google Analytics<br />

module and the Display Suite module. First we’ll download the Google Analytics module by downloading<br />

its files to the server, and then we’ll download the Display Suite module using the section approach, via the<br />

“Install new module” feature.<br />

Downloading Module Files to Your Server<br />

I’ll demonstrate how to install the Google Analytics module by downloading the module file to the module<br />

directory on my <strong>Drupal</strong> 8 site. The steps are as follows:<br />

1. Visit <strong>Drupal</strong>.org/project/modules and find the module. You can use the Search<br />

feature or the filters on the Modules page to locate a module, but knowing that<br />

<strong>Drupal</strong>.org’s standard naming convention for the URLs of modules is to use the<br />

name of the module as the last element of the URL speeds the search for the<br />

Google Analytics module: visit www.drupal.org/project/google_analytics.<br />

2. Scroll down to the Downloads section for the module. You should, in most cases,<br />

select the current release for the module that you are installing. The current<br />

release should be highlighted with a green background. In some cases, you may<br />

need to use a module that is still in development because a stable production<br />

version is not yet available. Development versions are typically highlighted with<br />

a red background and have a version number that ends in -dev. You should use<br />

preproduction (dev) versions with caution, as those modules are not yet fully<br />

developed and have not been thoroughly tested. To download a module rightclick<br />

the tar.gz link for the <strong>Drupal</strong> 8 version (8.x), and click the Save option<br />

provided by your browser in the pop-up menu. If your <strong>Drupal</strong> 8 installation is<br />

128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!