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 9 ■ Views<br />

Figure 9-3. The Views edit page<br />

At first glance, the form for defining a view looks complex and overwhelming. Fortunately, looks<br />

are deceiving.<br />

The first thing you’ll see at the top of the view configuration form is a Displays list. In our example view,<br />

we have a Page and a Block. One of the powerful features of Views is the ability to have a single view render<br />

multiple displays. Examples of the types of displays that we might use for recent articles include<br />

• A full page display that displays all the details of every Article published on the site.<br />

• A block that lists the five most recent Articles, displaying only the title for each article.<br />

• Another block that lists the five most recent Articles, displaying the title and a<br />

shortened version of the article body.<br />

• Yet another block that lists the ten most recent Articles, displaying the title, the date<br />

the article was published, the author who wrote the article, and a shortened version<br />

of the article body.<br />

This single view can be used to create several different types of displays that each display Articles in<br />

slightly different formats.<br />

We will start by defining the two displays, Page and Block, that were automatically created by Views<br />

when we selected the options on the first configuration screen (refer to Figure 9-2). We’ll add to that list of<br />

displays after we have the first two working.<br />

102

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

Saved successfully!

Ooh no, something went wrong!