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.
Page Display<br />
Chapter 9 ■ Views<br />
Let’s define the Page display first. Click the Page button that appears directly under Displays to configure<br />
the Page display. On this page we will display the complete Article, which includes the title, body, author<br />
of the article, and the date and time that it was published. Let’s work top to bottom, left to right through the<br />
configuration parameters that we need to set to make this page display what we want it to:<br />
1. Change the “Display name” from “Page” to something a little more descriptive,<br />
something like “All Articles Page.” To change the value, click “Page” to the<br />
right of “Display name” and in the pop-up form enter the new value in the<br />
“Administrative name” field, followed by clicking the Apply button. You’ll see that<br />
the new value is displayed both in the Displays area of the view edit form and in<br />
the “Display name” field in the left column.<br />
2. In the Title section, change the Title of the view. This value is displayed at the top<br />
of the output generated by views for this display. Let’s change it to “All Articles.”<br />
Click “Recent Articles” and select “This page (override)” from the For select list.<br />
This means that the changes we are making to this value will only be applied to<br />
this specific view display. If you leave the value set to “All displays,” every display<br />
will show this new title. Since we’re going to have different displays for different<br />
purposes, “All Articles” is likely a poor choice of titles for other displays.<br />
3. In the Format section, we have the option to generate a list using different output<br />
formats. Click the “Unformatted list” value for Format to see a list of output<br />
options:<br />
• Grid: The output is displayed in rows and columns; in our example, each article<br />
would fill one column on a row in the grid. This is a great option for displaying<br />
photos in a photo gallery.<br />
• HTML list: The output is displayed as either an ordered list or an unordered list.<br />
In our example, each article would be listed as a within a or<br />
tag. If you’re not familiar with HTML tags, check out the great tutorial<br />
at www.w3schools.com/html or pick up one of the great introductory books on<br />
HTML development at www.apress.com.<br />
• Table: The output is displayed as an HTML table, where each field is displayed<br />
in a column. A table is great when you want to provide visitors with the ability to<br />
sort the output of a view by the values within a column.<br />
• Unformatted list: The output is displayed as a list, but unlike the HTML list, there<br />
are no enclosing , , or tags.<br />
For our example Page, we’ll leave the value set to “Unformatted list.” Remember<br />
to select “This page (override)” from the For select list when changing the value<br />
to something other than “Unformatted list.” If you click Settings to the right of<br />
“Unformatted list,” you’ll see the configuration options available for that type of<br />
list. Each of the options has its own set of parameters that you can set.<br />
103