Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Drupal 8 Views
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Drupal 8 Views

Mastering Drupal 8 Views

By : Marshall
3.4 (7)
close
close
Mastering Drupal 8 Views

Mastering Drupal 8 Views

3.4 (7)
By: 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 (13 chapters)
close
close
12
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.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY