Book Image

Mastering Drupal 8 Views

By : Gregg Marshall
Book Image

Mastering Drupal 8 Views

By: Gregg Marshall

Overview of this book

Learn how to build complex displays of content—all without programming. Views were used on more than 80% of all Drupal 7 sites; now they are part of the Drupal 8 core. While most site builders and site owners are aware of views, they don't understand how to take full advantage of their power to create many amazing pages and blocks. If they use views, they might build 10 different view displays with different filters, without knowing that a contextual filter would require only a single display. Using our sample company, we'll take its existing content and evolve an ever more complex and powerful website for that company, starting with adapting the administration the user sees and moving on to making complex pages of information for site visitors. While the book is written for Drupal 8, the similarities between Views in Drupal 7 and 8 make this a useful reference for Drupal 7 site builders also.
Table of Contents (20 chapters)
Mastering Drupal 8 Views
Credits
Foreword
About the Author
Acknowledgements
About the Reviewer
www.PacktPub.com
Preface
Index

Summary


Drupal's default sorting isn't very useful. We showed how to set up single-level and multilevel sorting, then added exposed sorts. Using an exposed sort gives visitors flexibility in how they view the content not contained in tables, which can use the built-in sortable columns options. From order, we covered filtering. Filtering lets a View builder control what information should be displayed, selecting a subset of the query-generated extracts from the database. For those who know SQL, this is the WHERE clause in most SQL queries. Exposed filters again give the visitor more control of how and what is displayed—in our example, limiting property listings by size (bedrooms), cost, and/or neighborhood.

In the next chapter, we'll extend the exposed filter concept to the ways by which Drupal sites can pass the filter criteria via the URL as well as use information from the page being displayed to control the information displayed in a block. These are called contextual filters and are a...