Drupal 8 Development: Beginner's Guide - Second Edition

Develop your programming skills by creating engaging websites using Drupal 8

Drupal 8 Development: Beginner's Guide - Second Edition

This ebook is included in a Mapt subscription
Neeraj Kumar et al.

2 customer reviews
Develop your programming skills by creating engaging websites using Drupal 8
$0.00
$30.60
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785284885
Paperback398 pages

Book Description

Drupal is one of the most popular platforms with which to develop websites. With more and more organizations looking to build engaging digital experience for their stakeholders, the Drupal Content Management System offers a mobile-first platform with native support for integrations, better performance, and scalability. The new version brings significant changes to its module development and theme creation techniques, improving performance and refining the development experience.

This book will help you develop your own website using Drupal 8 in a step-by-step manner. You’ll start off by setting up your development environment, enabling you to begin writing custom code for a Drupal-powered website through PHPStorm. You will learn about configuration management and creating custom content types before exploring the HTML5 features included with Drupal 8.

You will then get familiar with Drupal 8’s mobile-first features, explore the built-in WYSIWYG and in-line editing capabilities of Drupal 8, and enhance the overall authoring experience. Later, you will create and enhance a Media Entity Lightbox module, before taking an in-depth look at the Views module.

We then cover some advanced search concepts and walk you through the installation and integration of the Java-based Apache Solr search engine. Finally, you will explore and configure the built-in support for REST and extend its support by installing the RESTful module. By the end of the book, you will have created a recipe sharing website while gaining a solid understanding of development best practices for Drupal 8.

Table of Contents

Chapter 1: Setting Up a Drupal Development Environment
Installing Drupal for local development
Time for action – installing Drupal using Acquia Dev Desktop
Time for action – installing a Mac OS X AMP stack
Time for action – installing a Windows AMP Stack
Time for action – modifying the php.ini settings
Time for action – setting up MySQL for Drupal
Time for action – creating an empty MySQL database
Installing Git
Time for action – installing Git for Mac OS X
Time for action – installing Git for Windows
Installing Drush
Time for action – installing Drush for Mac OS X
Time for action – installing Drush for Windows
Installing Drupal 8
Time for action – installing Drupal 8
Installing the PHPStorm IDE
Time for action – installing the PHPStorm IDE
Time for action – creating a new PHPStorm project
Drupalize PHPStorm IDE
Drupal from a developer's perspective
Installing Vagrant
Time for action – installing Vagrant
Summary
Chapter 2: Custom Module Development
Creating custom Recipe content type
Time for action – creating custom content type
Time for action – adding a new recipe
Time for action – developing a custom module in Drupal 8
Time for action – developing custom field formatter
Test-driven development (TDD)
Time for action – writing and testing functional test from our d8dev custom module
Summary
Chapter 3: Drupal Views and Configuration Management
A quick introduction to Views
Time for action – creating a recipe listing block using views
Configuration management in Drupal 8
Using the Configuration Management interface
Time for action – importing, exporting, and synchronizing configurations
Working of Configuration Management in Drupal 8
Changing the active configuration storage
Introducing the Devel module
Time for action – generating dummy content using the devel_generate module
Summary
Chapter 4: Introduction to the Field Types API and Developing the Custom Field Module
Introducing the NutritionInformation module
Time for action – developing a custom module for a compound NutritionInformation field
Time for action – updating the Recipe content type to use the NutritionInformation field
Summary
Chapter 5: Theming in Drupal 8
What is a theme?
Time for action – creating a sub-theme
Mobile first, responsive themes
Time for action – installing Drush
Time for action – Adding assets to your theme
Time for action – calling assets on specific pages
Introduction to templating and Twig
Debugging Twig
Time for action – Twig in practice
Time for action – understanding the benefits of contributed modules
What are contributed modules?
Summary
Chapter 6: Enhancing the Content Author's User Experience
A quick introduction to CKEditor in Drupal 8
Configuring CKEditor profiles
Time for action - adding some buttons to the basic HTML profile
Time for action - exporting CKEditor configuration
Adding a new CKEditor profile
Time for action - creating a text-only control profile for anonymous users
Classic editor and inline editing
Time for action – using inline editing
Adding widgets to CKEditor
Introduction to the Block API for Drupal 8
Time for action – creating a block to aid the authoring experience
Time for action – including default configuration in your module
Summary
Chapter 7: Adding Media to Our Site
Introduction to the File entity module
Working with dev versions of modules
Time for action – installing a dev version of the File entity module
A new recipe for our site
Time for action – adding a Recipe images field to our Recipe content type
Creating a custom image style
Time for action – adding a custom image style through the image style administrative page
Time for action – creating a programmatic custom image style
Integrating the Colorbox and File entity modules
Time for action – installing the Colorbox module
Working with Drupal issue queues
Time for action – creating an issue for the Colorbox module
Summary
Chapter 8: How Does It Taste? – Getting Feedback
Introduction to the Drupal contact form
Time for action – enabling and configuring the core contact form
Adding placeholder text to our contact form
Time for action – adding placeholder text to our site contact form
Using custom code to add placeholder text to the Name and Email fields
Time for action – adding placeholder text to Name and Email fields
Time for another recipe!
Colorbox file enhancements
Time for action – enhancing the Colorbox module with image title and alt captions
Contributing our code to Drupal
Time for action – creating a patch and uploading it on the Drupal issues queue
Recipe reviews with comments
Time for action – configuring comments as recipe reviews
Time for action – enhancing the liking system using comments and views
Summary
Chapter 9: Advanced Views Development
Views revisited – advanced configuration
Random top rated recipe block
Time for action – building a random top rated recipe block with Views
Taxonomy-based View with tabs
Time for action – creating a cuisine vocabulary to organize recipes
Time for action – creating a Recipes by cuisine type Views block
Time for action – installing and using the Views Field View module for our Recipe by Cuisine Type View
Tabbed Views display
Time for action – developing a Views style plugin for semantic tabs
Time for another Recipe
Contributing the Views semantic tabs module to Drupal
Time for action – creating a sandbox for the views semantic tabs module
Summary
Chapter 10: Drupal Project Management and Collaboration
Rotating banners with the Views Slideshow module
Time for action – installing the Views Slideshow module
Creating a rotating banner with Views Slideshow
Time for action – creating a banner using the Views Slideshow module
Time for action – creating a new image style for images in our rotating recipe banner
Enhancing the appearance of our front banner with a pager and CSS
Time for action – updating the front banner view to include a slide show pager
Time for another recipe
Time for action – creating README.txt and pushing to the sandbox
Time for action – promoting the Views semantic module to a full project on Drupal.org
Introducing the Features module
Time for action – installing the Features module
Time for action – using the Features module to export the Recipe content type and related configurations
When to use core Configuration Management compared to Features
Summary
Chapter 11: Searching Your Site with the Search API Module
The Drupal core search
The Search API module
Time for action – basic installation and configuration of the Search API module
Exposing the search to users
Installing Apache Solr as the search backend
Time for action – creating and configuring your virtual machine
Time for action – installing and configuring Solr on Ubuntu
Securing Apache Solr with Uncomplicated Firewall
Time for action – configuring Uncomplicated Firewall
The Search API Solr module
Time for action – configuring Drupal to use Apache Solr
Search facets
Time for action – building faceted search blocks
Summary
Chapter 12: RESTful Web Services in Drupal
Introduction to web services
Introduction to REST
Headless Drupal
RESTful web services in Drupal
Time for action – getting all the recipe types
Time for action – creating an API to get all the recipes under a recipe type
Time for action – consuming RESTful web services using AngularJS
Summary

What You Will Learn

  • Set up your Drupal development environment
  • Brush up on your understanding of the concepts of object-oriented programming, module development, and test-driven development
  • Install and configure Drupal, add new content type, and work through lot of dummy content to create listing pages using views
  • Enhance the content author’s user experience and custom block
  • Find out about field Type API and explore custom theme development
  • Manage various media types in Drupal for your content-rich website

Authors

Table of Contents

Chapter 1: Setting Up a Drupal Development Environment
Installing Drupal for local development
Time for action – installing Drupal using Acquia Dev Desktop
Time for action – installing a Mac OS X AMP stack
Time for action – installing a Windows AMP Stack
Time for action – modifying the php.ini settings
Time for action – setting up MySQL for Drupal
Time for action – creating an empty MySQL database
Installing Git
Time for action – installing Git for Mac OS X
Time for action – installing Git for Windows
Installing Drush
Time for action – installing Drush for Mac OS X
Time for action – installing Drush for Windows
Installing Drupal 8
Time for action – installing Drupal 8
Installing the PHPStorm IDE
Time for action – installing the PHPStorm IDE
Time for action – creating a new PHPStorm project
Drupalize PHPStorm IDE
Drupal from a developer's perspective
Installing Vagrant
Time for action – installing Vagrant
Summary
Chapter 2: Custom Module Development
Creating custom Recipe content type
Time for action – creating custom content type
Time for action – adding a new recipe
Time for action – developing a custom module in Drupal 8
Time for action – developing custom field formatter
Test-driven development (TDD)
Time for action – writing and testing functional test from our d8dev custom module
Summary
Chapter 3: Drupal Views and Configuration Management
A quick introduction to Views
Time for action – creating a recipe listing block using views
Configuration management in Drupal 8
Using the Configuration Management interface
Time for action – importing, exporting, and synchronizing configurations
Working of Configuration Management in Drupal 8
Changing the active configuration storage
Introducing the Devel module
Time for action – generating dummy content using the devel_generate module
Summary
Chapter 4: Introduction to the Field Types API and Developing the Custom Field Module
Introducing the NutritionInformation module
Time for action – developing a custom module for a compound NutritionInformation field
Time for action – updating the Recipe content type to use the NutritionInformation field
Summary
Chapter 5: Theming in Drupal 8
What is a theme?
Time for action – creating a sub-theme
Mobile first, responsive themes
Time for action – installing Drush
Time for action – Adding assets to your theme
Time for action – calling assets on specific pages
Introduction to templating and Twig
Debugging Twig
Time for action – Twig in practice
Time for action – understanding the benefits of contributed modules
What are contributed modules?
Summary
Chapter 6: Enhancing the Content Author's User Experience
A quick introduction to CKEditor in Drupal 8
Configuring CKEditor profiles
Time for action - adding some buttons to the basic HTML profile
Time for action - exporting CKEditor configuration
Adding a new CKEditor profile
Time for action - creating a text-only control profile for anonymous users
Classic editor and inline editing
Time for action – using inline editing
Adding widgets to CKEditor
Introduction to the Block API for Drupal 8
Time for action – creating a block to aid the authoring experience
Time for action – including default configuration in your module
Summary
Chapter 7: Adding Media to Our Site
Introduction to the File entity module
Working with dev versions of modules
Time for action – installing a dev version of the File entity module
A new recipe for our site
Time for action – adding a Recipe images field to our Recipe content type
Creating a custom image style
Time for action – adding a custom image style through the image style administrative page
Time for action – creating a programmatic custom image style
Integrating the Colorbox and File entity modules
Time for action – installing the Colorbox module
Working with Drupal issue queues
Time for action – creating an issue for the Colorbox module
Summary
Chapter 8: How Does It Taste? – Getting Feedback
Introduction to the Drupal contact form
Time for action – enabling and configuring the core contact form
Adding placeholder text to our contact form
Time for action – adding placeholder text to our site contact form
Using custom code to add placeholder text to the Name and Email fields
Time for action – adding placeholder text to Name and Email fields
Time for another recipe!
Colorbox file enhancements
Time for action – enhancing the Colorbox module with image title and alt captions
Contributing our code to Drupal
Time for action – creating a patch and uploading it on the Drupal issues queue
Recipe reviews with comments
Time for action – configuring comments as recipe reviews
Time for action – enhancing the liking system using comments and views
Summary
Chapter 9: Advanced Views Development
Views revisited – advanced configuration
Random top rated recipe block
Time for action – building a random top rated recipe block with Views
Taxonomy-based View with tabs
Time for action – creating a cuisine vocabulary to organize recipes
Time for action – creating a Recipes by cuisine type Views block
Time for action – installing and using the Views Field View module for our Recipe by Cuisine Type View
Tabbed Views display
Time for action – developing a Views style plugin for semantic tabs
Time for another Recipe
Contributing the Views semantic tabs module to Drupal
Time for action – creating a sandbox for the views semantic tabs module
Summary
Chapter 10: Drupal Project Management and Collaboration
Rotating banners with the Views Slideshow module
Time for action – installing the Views Slideshow module
Creating a rotating banner with Views Slideshow
Time for action – creating a banner using the Views Slideshow module
Time for action – creating a new image style for images in our rotating recipe banner
Enhancing the appearance of our front banner with a pager and CSS
Time for action – updating the front banner view to include a slide show pager
Time for another recipe
Time for action – creating README.txt and pushing to the sandbox
Time for action – promoting the Views semantic module to a full project on Drupal.org
Introducing the Features module
Time for action – installing the Features module
Time for action – using the Features module to export the Recipe content type and related configurations
When to use core Configuration Management compared to Features
Summary
Chapter 11: Searching Your Site with the Search API Module
The Drupal core search
The Search API module
Time for action – basic installation and configuration of the Search API module
Exposing the search to users
Installing Apache Solr as the search backend
Time for action – creating and configuring your virtual machine
Time for action – installing and configuring Solr on Ubuntu
Securing Apache Solr with Uncomplicated Firewall
Time for action – configuring Uncomplicated Firewall
The Search API Solr module
Time for action – configuring Drupal to use Apache Solr
Search facets
Time for action – building faceted search blocks
Summary
Chapter 12: RESTful Web Services in Drupal
Introduction to web services
Introduction to REST
Headless Drupal
RESTful web services in Drupal
Time for action – getting all the recipe types
Time for action – creating an API to get all the recipes under a recipe type
Time for action – consuming RESTful web services using AngularJS
Summary

Book Details

ISBN 139781785284885
Paperback398 pages
Read More
From 2 reviews

Read More Reviews