Mastering Drupal 8 Views

Sub-title: 
Build sophisticated displays of your Drupal content, all without programming
Authors: 
Publisher: 
Packt Publication
Publication date: 
2016-05
Page count: 
250
ISBN-13: 
9781785886966

Accelerate your development process using Drupal 8 Views through this advanced, practical guide.

Key features

  • 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

Topic and description

Learn how to build complex displays of content—all without programming.

Views was used on more than 80% of all Drupal 7 sites; now it is part of the Drupal 8 core. While many site builders and site owners are aware of Views, they don't understand how to take full advantage of its power to create many amazing pages and blocks. If they are using 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.

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 as the designer specifies
  • Change the order in which a list of content is displayed, and limit the content shown to certain content types or values
  • Filter content using values passed to the view in the URL, making a single view work in different ways

Multilingual Guide in Drupal 8

Enable Multilingual modules

After installation, check if all Drupal 8 Multilingual modules are enabled. If not, enabled them

Menu: Manage > Extend
Path: /admin/modules#edit-modules-multilingual

Module:

  • Configuration Translation
  • Content Translation
  • Interface Translation
  • Language

About languages

Default language is chosen during installation. Let's add more languages for kickstart multilingual setup.

Including Part Template

Many themers prefer to keep header / footer codes in a separate file and call the file in page.html.twig

Let's say you have created following file in your theme folder for header.
/THEME_NAME/includes/header.html.twig

And now you want to include this file in page.html.twig

Use below code to include this file.

{% include directory ~ '/includes/header.html.twig' %}

Entity Pilot - content staging for Drupal 8

Installation

  • Download and extract the module
  • Add the php-encryption library using composer or Composer manager.
    • For composer - from your Drupal installation directory run composer require "defuse/php-encryption:~1.2.
    • For Composer manager, refer to its documentation

Getting started

How to Setup Drush for Drupal 8

Quick video tutorial on how to set up drush for drupal 8. This covers both windows and linux.

Non-video tutorials

Directions are available on Drupalize.me. Which can be found here: Upgrading Drush to work with Drupal 8-dev

Testing

Finally for some QA. Let's check that our module works as expected by writing a few tests of our own which can be run via Drupal itself.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8