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 />

Views<br />

Views is either the first or second module that comes to mind when you ask experienced <strong>Drupal</strong> developers<br />

what their most favorite module is. The Views module is like a Swiss army knife for selecting and rendering<br />

content on your site. An example of how you might use views is a case where you created 50 pieces of<br />

content, each item describing a news event that occurred in the past. You may have a requirement to list<br />

those 50 items sorted by the date that each story was published. Views can do that for you. Additionally you<br />

may want the list of news articles to be listed in tabular format, like an Excel spreadsheet. Views can do that<br />

for you. You may also want to provide visitors with a page that lists the news article as a table with the ability<br />

to sort the articles by clicking one of the titles in the table view of articles. Views can do that for you. You can<br />

also provide a filtering mechanism so visitors can pick a subject, person, or location associated with all of<br />

your news stories and only see those articles that meet the selected criteria. Views can do that for you. You<br />

may also want to provide an RSS feed of the news articles to visitors who use feed aggregators. Views can<br />

do that for you. Views is an amazingly easy-to-use module that is extremely powerful and a “must have” on<br />

nearly everyone’s list, and the good news is that it’s part of <strong>Drupal</strong> 8 core. Chapter 9 describes in detail how<br />

to use Views.<br />

Layout<br />

A close second to Views in popularity is the Layout module. As we placed blocks on pages in Chapter 8, you<br />

saw that we were limited to putting blocks into the regions defined by the Bartik theme that we were using.<br />

But what if we wanted to divide the content area into rows and columns so that we can create landing pages<br />

with lots of elements? The Layout module comes to the rescue. For advanced page layouts, there isn’t a tool<br />

that is easier to use and more powerful than the Layout module. Chapter 10 describes how to use Layouts.<br />

Rules<br />

The Rules module enables administrators to define conditionally executed actions based on events. For<br />

example, if you want to send an e-mail automatically to a content administrator every time a comment is<br />

posted to the site, for the administrator’s review and approval, you can use Rules to configure that action.<br />

Display Suite<br />

Display Suite gives you a drag-and-drop interface that allows you to take full control over how your content<br />

is displayed. Arrange your nodes, views, comments, and user data the way you want without having to walk<br />

through dozens of template files.<br />

Nicemenus<br />

<strong>Drupal</strong>’s out-of-the-box menu features provide an easy-to-use mechanism for creating horizontal and<br />

vertical menus, where those menus are restricted to a single level. In many cases you’ll want to have the<br />

ability to create menus that have drop-downs (for horizontal menus) or fly-outs (for vertical menus).<br />

<strong>Drupal</strong>’s menuing system provides the ability to assign menu items in a hierarchical fashion; however, it is<br />

up to us, <strong>Drupal</strong> developers, to format menus so that items drop down or fly out when a user hovers over<br />

a menu item. Fortunately, we have the Nicemenus module that automatically handles the rendering of<br />

drop-downs and fly-outs.<br />

138

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

Saved successfully!

Ooh no, something went wrong!