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
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 9 ■ Views<br />
There are additional styling options, but in most instances leaving the default values for those options is<br />
sufficient. Click the Apply button to complete this step in the process.<br />
A table with a single column is pretty boring, really nothing more than just a list. So to spice up the<br />
table let’s add two additional fields, one for the date that the article was created, and another for the tags<br />
associated with the article. We’ll add each field as a separate column. To add the fields, click the Add button<br />
in the Fields section of the page (see Figure 9-3), which reveals the list of every field available to display on<br />
our view. To simplify finding the fields that we want, enter “created” in the Search box at the top of the list of<br />
fields, and from the list of results that is displayed, check the box next to the “Content: Authored on” field.<br />
Select the For option of “This block (override)” to prevent this field from being added to all of the other<br />
view displays that we’ve created, and then click the “Apply (this display)” button. The next screen provides<br />
options to configure how the “Authored on” field will be rendered, including the label displayed for that<br />
field, CSS styling options, what to do when there isn’t a value present for a given article, and other options.<br />
Leave all the values set to their defaults for the remaining options and click Apply.<br />
Views Add-on Modules<br />
The Views module itself is a powerful tool for rendering content on your site. When you combine Views<br />
with other specialized modules, you get a whole new level of powerful capabilities. There are several “must<br />
have” Views add-on modules that you may wish to consider as you build out your site. Here are a few of my<br />
favorites:<br />
• Views Slideshow (www.drupal.org/project/views_slideshow): This module<br />
provides a simple-to-use interface for creating views that display content as a<br />
slideshow. There are a number of slideshow modules for Views, but this happens to<br />
be one of the easiest to use.<br />
• Calendar (www.drupal.org/project/calendar): Need to display events on a<br />
calendar? This is the module for you. It provides you with a rich set of tools for<br />
creating and displaying any content that contains a date field and date values on a<br />
calendar (day, week, month, year). It’s one of the must-have modules on all my sites.<br />
• JCarousel (www.drupal.org/project/jcarousel): Most of my projects involve some<br />
form of displaying content in a carousel. This module makes it simple to create a list<br />
of content items and render them as a carousel.<br />
• Draggable Views (www.drupal.org/project/draggableviews): Want to provide<br />
an administrative interface that allows content editors to rearrange the items<br />
that appear in a view? This module provides a simple drag-and-drop interface to<br />
rearrange items in your view.<br />
• GMap (www.drupal.org/project/gmap): Want to render content that has geographic<br />
(address) information on a map? This module integrates Google Maps with Views to<br />
provide an easy-to-use solution for rendering content items on a map.<br />
• Views data export (www.drupal.org/project/views_data_export): Want to export<br />
content from your site into a CSV file, spreadsheet, Word document, text file, or<br />
XML? This module provides the ability to do just that.<br />
There are also add-on modules for Views that we did not cover in this section. Please visit<br />
www.drupal.org/project/project_module and click the Views link in the categories listed in the right<br />
column. At the time of writing, there are 756 contributed modules just for Views! Browse through the list<br />
(remembering to look to see if there is a <strong>Drupal</strong> 8 version of the modules you may be interested in). People<br />
have created many amazing capabilities for Views.<br />
115