Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Drupal 8 Views

You're reading from   Mastering Drupal 8 Views Build sophisticated displays of your Drupal content, all without programming

Arrow left icon
Product type Paperback
Published in May 2016
Publisher
ISBN-13 9781785886966
Length 272 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Gregg Marshall Gregg Marshall
Author Profile Icon Gregg Marshall
Gregg Marshall
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Up and Running with Views FREE CHAPTER 2. Views from Scratch 3. Sorting and Filtering 4. Contextual Filters 5. Relationships 6. Add-on Modules 7. Field Rewrites 8. Customizing Views 9. Advanced View Settings 10. Theming Views A. Content Types for a Sample Site Index

What this book covers

The first thing you will notice is that this isn't your traditional technical book written in a dry third-party tone. It reads a bit more like a novel, following Lynn as she learns how to master Views. Jackson, her cat, and Jim, her mentor, are along for the ride and to let the story change viewpoints from time to time (and to give Lynn "people" to talk to).

Views is an amazing part of Drupal 8. I hope you will enjoy this approach to explaining it.

Chapter 1, Up and Running with Views, deals with the Views main administration page and setting pages and does a quick run-through of View's edit screen by modifying an existing core view.

Chapter 2, Views from Scratch, starts the in-depth exploration of Views, starting with building a simple property listing that most real estate sites might have. We will define some Views terms such as View Types, displays, Display Formats, and Display Contents. We'll end with an interesting view that displays selected events from Drupal's watchdog log to users that might normally not be able to see them.

Chapter 3, Sorting and Filtering, introduces sorting and filtering. Sorting lets you specify the order you want your results to be displayed in. We will move on to limiting which results are even displayed using filtering. You can also expose a filter to the user and let them select which results to show. Finally, we'll show how to group the results when a view results in multiple rows for each value.

Chapter 4, Contextual Filters, takes filtering to the next level by adding contextual filters. Contextual filters use the URL to pass the selection criteria to the filter.

Chapter 5, Relationships, shows how to use relationships to gain access to even more data to display. Using the built-in entity reference, any reference field can be used to add all the fields in the referenced content to the available fields list.

Chapter 6, Add-on Modules, adds more Display Formats using add-on contributed modules. Using add-on modules, we can add a slideshow or a rotating carousel as easily as enabling the module, installing the JavaScript library it uses, and defining a very simple view.

Chapter 7, Field Rewrites, is about field rewrites. It is uncommon that the default output of a view exactly meets your needs, including the if-then-else values, in which if a condition is true, one value is displayed, but if it isn't true, another value is displayed.

Chapter 8, Customizing Views, covers the rest of the options in the center column of the view edit page, such as custom headers, footers, and special messages if a set of filters (defined, exposed, or contextual) results in no results.

Chapter 9, Advanced View Settings, deals with all of the advanced settings except contextual filters and relationships, which are covered in earlier chapters.

Chapter 10, Theming Views, winds up the book with how to theme or style the output of Views. Some CSS support can be easily added through the user interface; other, more complex changes might require replacing the Twig templates used by Views with custom templates that do manipulations not possible from the user interface.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image