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
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Mastering Drupal 8 Views
Mastering Drupal 8 Views

Mastering Drupal 8 Views: Build sophisticated displays of your Drupal content, all without programming

eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Mastering Drupal 8 Views

Chapter 2. Views from Scratch

In this chapter, we'll cover the basics of building Drupal Views. After building a simple listing of available properties, we will look at some Views terminology that defines the components of a view:

  • Views types
  • Displays
  • Display Formats
  • Display Contents

Finally, we'll finish the chapter by building a view from Drupal's watchdog log, which is something new in Drupal 8.

A first try at listing the available properties

"Okay, Jackson, we've modified an existing view. I think it's time to learn how to build my own views in Drupal 8." Lynn gave Jackson a nice scratch knowing she'd be ignoring him for a few hours while she worked her way through this first view on her own.

Starting at the Views listing page (Manage | Structure | Views), Lynn clicked on the Add new view button that is prominently at the top of the Views listing page. "This is a nice change from Drupal 7, where adding a view was just an unformatted link." After the page loaded, Lynn faced an empty form similar to the one here:

A first try at listing the available properties

The blank Add new view screen

"Okay, this doesn't look too complex. Let's call this view Available Property Listing," said Lynn, as she typed the view name into the first field. Drupal automatically converts the name entered into this field into a machine name for Drupal to use internally.

Tip

Generally, the machine name...

The anatomy of a view

Lynn was confused a couple of times as she built her first view of available properties, so she decided that an hour with Jim would be really handy. Calling Jim, she said "Hi Jim, I just built my first view on the development site."

"Congratulations! That's a big step forward," he replied.

"However, I found it really confusing. There are so many options, and the terminology is so different from anything I've worked with before. I wonder whether you would have some time soon to sort of walk me through some of what I saw. I have a feeling if I master some of this terminology, the rest will fall into place."

"Drupal does have its own unique language. Some words don't exist anywhere else, and others have different meanings from what you might be used to hearing. I agree a quick rundown would be handy. Do you have a free hour some evening this week?"

Jim and Lynn decided to meet at a local Starbucks on Tuesday evening while...

Showing the Watchdog logs

That weekend, Lynn finally had time for Jim's homework. She decided that a block showing the five most recent errors would be available for everyone who could log in. At the bottom of this block would be a See more link to go to a page that showed all the page not found errors in a table format.

Adding the Views

Again starting at the Views listing page (Manage | Structure | Views), Lynn clicked on the Add new view button. She then completed the following fields:

  • View name: Page Not Found Errors
  • Description: field checked with text Display URLs of page not found errors from the Drupal Watchdog log
  • VIEW SETTINGS Show: Log entries
  • Sorted by: Newest first
  • PAGE SETTINGS Create a page: field checked
  • Page title: Page Not Found Errors
  • Path: administration/page-not-found-errors
  • PAGE DISPLAY SETTINGS Display format: Table of fields
  • Items to display: 25
  • Use a pager: field checked
  • Create a menu link: field unchecked
  • Include an RSS feed: field unchecked
  • BLOCK SETTINGS Create a block...

Summary

In this chapter, Lynn built a simple table of properties for sale, displaying the address and asking price, number of bedrooms, square footage, and neighborhood. Jim explained the various terms that Views uses to define a view: View Type, display, display type, and Display Contents, going through each option for these terms and the possible uses. Finally, Lynn built a view of bad links, adding both a page and a block display using another table Display Format for the page and an unformatted list Display Format for the block.

In the next chapter, we'll extend the properties list to have better sorting and filtering, including a multilevel sort, and use exposed filters to let site visitors customize the information being displayed, making the site interactive instead of full of static content.

Left arrow icon Right arrow icon

Key benefits

  • A practical, step-by-step guide with illustrative examples to give you a clear understanding of Drupal 8 views
  • Get the only book on the market that talks about Drupal 8 views and their importance for developers
  • Get an understanding of how views work and how they help to create modular applications

Description

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.

Who is this book for?

This book is for web developers, web designers, and website administrators who use Drupal 8, have some basic knowledge of managing and developing apps with Drupal, and who want to get an advanced, practical knowledge of views and how to leverage them in Drupal 8 applications.

What you will learn

  • Create displays of content that are automatically updated when you add new content
  • Show maps and rotating image carousels on your site
  • Combine content to create composite displays using the same data in different ways
  • Use fields from more than one content type to create powerful views of multi-table data
  • Modify the field data being displayed, combining it in different ways or changing the HTML that might be normally generated
  • Add headers and footers above and below a views display
  • Make the output of your view look exactly like the designer specifies
  • Change the order in which a list of content is displayed, limit the content shown to only certain content types or values
  • Filter content using values passed to the view in the URL, making a single view work different ways
Estimated delivery fee Deliver to Russia

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 24, 2016
Length: 272 pages
Edition : 1st
Language : English
ISBN-13 : 9781785886966
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Russia

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : May 24, 2016
Length: 272 pages
Edition : 1st
Language : English
ISBN-13 : 9781785886966
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 97.98
Drupal 8 Theming with Twig
$48.99
Mastering Drupal 8 Views
$48.99
Total $ 97.98 Stars icon

Table of Contents

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

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.4
(7 Ratings)
5 star 28.6%
4 star 42.9%
3 star 0%
2 star 0%
1 star 28.6%
Filter icon Filter
Top Reviews

Filter reviews by




Eric Jun 27, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Mastering Drupal 8 Views takes a different approach to web development books. Most books guide you through a process, step by step, in a very cold mechanical manner. This book differs from that approach completely.The writing style of this book was hard to accept at first. Because, as I previously stated, web development books aren't usually written in conversational language. After the first chapter I realized that the first-person Point of View, tone, and practicality of speech the author uses had me understanding much more about each Views feature than other books on the topic. It was at that point that I realized that the background story was essential in building up the "real world" application of the tasks you are performing. I proceeded to go back and actually read it, rather than skipping it, which I usually do with books like this.After each session with Lynn, the protagonist of the story, you are brought into a room with her Drupal mentor, Jim. Jim brings it home with high level technical details, explaining the most confusing of View settings with practical language and are immediately relatable. I feel as if Jim were a real person, he and I would be friends.The only issues I had with the book were out of the authors control.Writing a book on a product that changes so rapidly, like Drupal 8 does, must have been a difficult process. Gregg makes note of this throughout the book. Noting where there may be discrepancies along the way. The inclusion of these was a blessing and a curse, as many times you aren't sure whether or not a setting will actually exist.Overall, this book is a great master course on Drupal 8 Views. It is a book suitable for beginners, who are just getting started. It also brings a lot to the table for Views masters who are looking to see what has changed when moving to Drupal 8. I'd recommend that anyone interested in learning Views give this a read.
Amazon Verified review Amazon
mada namlig Jul 20, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Never did I think a skill-building manual could be informative AND engaging. In Mastering Drupal 8 Views, Gregg Marshall tells the story of Lynn, an owner of a realty firm with a Drupal website. She is charged with enhancing her firm's site. Although she has a basic understanding of Views, she sets out to learn everything she can about it.Gregg Marshall brings you along on Lynn's website and skill development journey through Views in an easy-to-follow, relatable tone. He does not assume the reader has any less or more Drupal knowledge than Lynn. The reader will learn Views skill in a very practical sense. For example: the purpose of relationships in Views is X and by using them, Lynn is able to do X on her website and, furthermore, Y and Z, too. Then you'll follow Lynn's path to implementation (pitfalls and all).Gregg does a great job of presenting the lessons in such a way that you can steadily build and refine your skill from the beginning or jump in at a point where you feel confident....eagerly awaiting the sql :)
Amazon Verified review Amazon
Michael Anello Jun 25, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book is one of the (I can only assume) many Drupal 8-focused books that will be released in the coming months. It is a very good deep dive into many of the hidden corners of the Views module, albeit with an interesting format. Not completely structured like a typical how-to software book, Gregg takes a bit more of a novel approach (pun intended) - he takes the reader on a journey through the Views module through the eyes of Lynn, a small business owner (Lynn's cat and Drupal consultant also have prominent roles). While some readers might find the story-ish elements distracting, they add a certain degree of warmth to the book - something I can only assume a subset of readers will more than appreciate.There are several stand-out chapters of this book, and luckily they're on some of the more difficult Views-related topics including contextual filters, relationships, and field rewrites. For people with questions about these topics, these chapters are more than worth the price of the book.Overall, this is a welcome addition to the Drupal family of books, and one that I can honestly recommend for users that feel like there are aspects of the Views module that are still a mystery to them. The novel-like structure of the book normally doesn't get in the way of the lesson, but for readers who normally doesn't read technical books front-to-back (instead cherry picking only chapters of interest), it might be a bit distracting. While this is properly identified as a Drupal 8 book, much of the content is also valid for Drupal 7, including some of (in my opinion) the strongest chapters.
Amazon Verified review Amazon
Product Review Person Jun 26, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Mastering Drupal 8 Views is a top down dissection of Views in core going over what each thing does, and how to do those things. The book takes a non standard approach of using story telling and fiction to bring the reader on a journey where the protaganist "Lynn" learns and uses views for practical purposes.If you find the conventional developer book to be a bit dry and hard to follow, you might really enjoy reading and following the adventure. If you're looking for just dry documentation you may find yourself skipping around and scanning for the meaty bits. Overall Mastering Drupal 8 Views is a comprehensive and well organized learning tool.
Amazon Verified review Amazon
Abhaya Sharma Oct 13, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Views form a great tool for drupal websites. Gregg Marshall in his book has given a fairly good introduction and deployment of drupal vies as applied to Drupal 8 which has incoporated views in its core structure.Anyone who wants to use drupal for designing web contents has to fully understand the views besides the other tools like taxomomy, blocks, menus and themes. The power of views has been deftly introduced in this book by way of a Drupal developer Lynn who is hosting a realtor site for property listings. The book is not exactly for beginners though someone initiated to learn a bit of Drupal and specifically want to take advantage of Drupal 8 should find this book more than useful. Masrhall has nicely organised his book with introducing views in first three basic chapters and later covered up tasks of contextual filters, relationships and add-on modules to work with views.Overall book has achieved what it was designed to achieve, a subtle and clean way to master views in Drupal 8.I would recommend the book for those who really wish to push their Drupal sites with the power of views. However, the layout of boxes showing views forms is a bit hazy and stressful to the eyes..
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela