O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drupal 8: Enterprise Web Development

Book Description

Harness the power of Drupal 8 to create enterprise-grade, highly scalable websites

About This Book

  • Build complete, complex websites with no prior knowledge of web development entirely using the intuitive Drupal user interface
  • Ensure your sites are modern, responsive and mobile-friendly through utilizing the full features available in Drupal 8
  • Quickly master theme administration, custom block layouts, views, and the Twig template structure

Who This Book Is For

This course is suitable for web developers, designers, as well as web administrators who are keen on building modern, scalable websites using Drupal 8 and its wide range of new features

What You Will Learn

  • Set up a local “stack” development environment and install your first Drupal 8 site
  • Find out what is available in the Drupal 8 core
  • Integrate third-party front-end and back-end libraries with Drupal
  • Understand the plugin system that powers many of Drupal 8's new APIs to extend its functionality
  • Build custom block layouts with reusable and fieldable blocks
  • Work with the new Twig PHP templating engine
  • Develop a theme from scratch following a step-by-step project outline

In Detail

This Drupal 8 course takes you through the journey of building, extending, and customizing websites to build highly scalable and enterprise-ready websites.

The first part—Learning Drupal 8—takes you step by step through building a Drupal 8 website. You will start with the basics, such as setting up a local “stack” development environment and installing your first Drupal 8 site, then we move on to image and media handling and extending Drupal modules. This section will help you get to grips with the modular nature of Drupal, and you’ll learn how to extend it by adding new functionalities to create your new modules. After learning to develop and manage a modern and responsive website using Drupal 8, you’ll start exploring different techniques to take advantage of the new Drupal 8 features.

The next module—Drupal 8 Development Cookbook—is your go-to guide to experimenting with all of Drupal 8’s features through helpful recipes. You will explore techniques to customize and configure the Drupal environment, create blocks and custom modules, as well as make your web apps responsive by harnessing the mobile-first feature of Drupal 8. This module will also show you how to incorporate multilingual facilities in your sites, use web services and third-party plugins with your applications from inside Drupal 8, and test and deploy your apps.

In the third part—Drupal 8 Theming with Twig—you will master Drupal 8’s new Twig templating engine to customize the look and feel of your website. This section will walk you through a real-world project to create a Twig theme from concept to completion while adopting best practices to implement CSS frameworks and JavaScript libraries. You will see just how quick and easy it is to create beautiful, responsive Drupal 8 websites while avoiding the common mistakes that many front-end developers make. By the end, you will have learned how to develop, manage, extend, and customize an enterprise-level website.

This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products:

  • Learning Drupal 8 by Nick Abbott and Richard Jones
  • Drupal 8 Development Cookbook by Matt Glaman
  • Drupal 8 Theming with Twig by Chaz Chumley

Style and approach

This course offers a thorough coverage of developing, managing, extending, and designing highly scalable websites using the Drupal 8 platform. Filled with practical examples and recipes, this course is a great combination of example-driven learning complemented by interesting techniques to take advantage of the Drupal platform.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Drupal 8: Enterprise Web Development
    1. Table of Contents
    2. Drupal 8: Enterprise Web Development
    3. Credits
    4. Preface
      1. What this learning path covers
      2. What you need for this learning path
      3. Who this learning path is for
      4. Reader feedback
      5. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    5. 1. Module 1
      1. 1. Introduction
        1. What is Drupal?
          1. Dynamic web pages – a brief history
            1. Enter the database
          2. A worldwide community
          3. The success of Drupal
            1. Multiple systems integration
            2. Technical debt
            3. Developer knowledge
          4. Modularity
            1. There's a module for that
        2. Some Drupal history
          1. Language choice
          2. Is Drupal a framework or platform?
            1. Embracing other communities' frameworks
          3. How an open source community works
        3. Summary
      2. 2. Installation
        1. System requirements
          1. PHP
          2. Web server options
          3. Database options
          4. Browser options
        2. Setting up a development environment
        3. Free cloud hosting
          1. Acquia Dev Desktop
        4. Installing Drupal 8
          1. Configuring your Drupal 8 site
        5. Troubleshooting your installation
          1. Memory settings
          2. PHP timeouts
        6. Trusted host patterns
        7. Summary
      3. 3. Basic Concepts
        1. Modules
          1. Core and contrib modules
          2. Where the core modules live
          3. Where your extension modules should live
          4. An example community module
          5. Evaluating new modules
          6. Documentation
          7. Module versions
        2. Entities, nodes, and fields
          1. Entities
          2. Nodes
            1. Node types
          3. Fields
            1. Adding new fields
            2. Field types
              1. General
              2. Number
              3. Reference
              4. Text
            3. Field settings
            4. Field widgets
          4. Form display
            1. Managing the form display
            2. Managing field display
          5. Drupal 8 core entity types
        3. Taxonomy
          1. Fixed terms or tags
        4. Blocks
        5. Views
        6. Users, roles, and permissions
        7. Themes
          1. Administration themes
          2. Base themes and subthemes
        8. Hooks
        9. Summary
      4. 4. Getting Started with the UI
        1. The Drupal 8 user interface
          1. Logging out
          2. Logging in
          3. Front page
          4. Repositioning the tray
        2. Responsiveness
          1. Administration theme
          2. Contextual links
        3. Quick content creation
        4. Listing content
          1. Revisiting the home page
        5. Structure
          1. Block layout
          2. Comment types
          3. Contact forms
            1. Personal contact form
          4. Content types
            1. Customizing a content type
            2. Customizing fields
            3. Customizing content entry screens
            4. Customizing the display
          5. Display modes
            1. View modes
            2. Form modes
          6. Menus
          7. Taxonomy
          8. Views
        6. Configuration
        7. Appearance
        8. People
        9. Reports
        10. Extend
        11. Summary
      5. 5. Basic Content
        1. Introducing your site-building scenario
          1. Types of content
            1. Pages
            2. Articles
            3. Clients
            4. Services
            5. Testimonials
            6. FAQs
          2. Contact information
          3. SEO considerations
        2. Basic pages
          1. Creating a new page
            1. Title
            2. Body
            3. Body field summary
              1. Rich text toolbar
              2. Default HTML restrictions
              3. Full HTML
              4. Restricted HTML
            4. Adding a page to the main navigation menu
              1. Nodes and unique IDs
            5. Adding more pages
        3. Articles
          1. Creating a new article
          2. Front page promotion
          3. Adjusting the settings for a content type
          4. Disabling front page promotion
          5. Adjusting comment settings
          6. Disabling future comments
            1. No retrospective action
            2. Retrospective action
              1. Threading
              2. Show reply form on the same page as comments
              3. Preview comments before posting
            3. Removing all comments and the ability to comment
        4. Summary
      6. 6. Structure
        1. Managing menus
          1. Reorganizing menu items
          2. Editing menu items
        2. Managing taxonomy
          1. Creating a new Taxonomy vocabulary
          2. Re-ordering Taxonomy terms
          3. Apply a taxonomy vocabulary to content types
            1. Adjusting the order of fields when editing
          4. Categorizing content
          5. Viewing categorized content
            1. Segregating article types using taxonomy
          6. Creating another taxonomy vocabulary
        3. Working with the Views module
          1. Creating a Views-powered News page
            1. View wizard
              1. Creating a new view
              2. Renaming a display
              3. Live preview
              4. Content settings
              5. Page settings
            2. Filtering to News only
          2. Creating a blog page
        4. Working with Views blocks
          1. Creating blocks using Views
          2. Placing the News blocks
            1. Block position
            2. Block visibility
        5. Summary
      7. 7. Advanced Content
        1. Field types
        2. Extending content types
          1. Adjusting field settings
            1. Forcing the Article type field to be mandatory
          2. Adjusting edit form settings
            1. Placeholder text
            2. Customizing view modes
            3. Removing the labels and fields from the display
            4. Controlling image size using styles
        3. Creating new content types
          1. Creating the Client content type
            1. Inherited fields
            2. Adding a logo field
              1. Tokens
              2. Image accessibility
            3. Linking clients to their web sites
            4. Providing an e-mail address for a Client
            5. Providing a telephone number for a Client
            6. Marking a Client as high profile
            7. Attaching taxonomy
              1. Reusing fields
            8. Adjusting field display settings
          2. Adding a sorted client list to the Clients page
            1. Views sort criteria
          3. Adding a pager to your view
          4. Creating the Service content type
            1. Enabling the linking of Services to Clients
            2. Displaying services listing using Views
          5. Creating the Testimonial content type
        4. Listing testimonials with a view
          1. Creating a grouped view
          2. The FAQ content type
            1. Content type settings
            2. Field settings
            3. Display settings
          3. Creating the simple FAQ page
          4. Adding interactive querying to a view
        5. Summary
      8. 8. Configuration
        1. People – Account settings
          1. Contact settings
          2. Anonymous users
          3. Administrator role
          4. Registration and cancellation
          5. Enable password strength indicator
          6. Account cancelation behavior
          7. Notification e-mail address
          8. Emails
        2. System
          1. Site information
          2. Cron
        3. Content authoring
          1. Text formats and editors
            1. Available filters
        4. User interface
          1. Shortcuts
        5. Development
          1. Performance
            1. Caching
            2. Clear cache
            3. Bandwidth optimization
          2. Logging and errors
          3. Maintenance mode
        6. Configuration synchronization
        7. Media
          1. File system
          2. Image styles
          3. Image toolkit
        8. Search and metadata
          1. Indexing progress
          2. Indexing throttle
          3. Default indexing settings
          4. Logging
          5. Search pages
          6. URL Aliases
        9. Regional and language
          1. Regional settings
            1. Locale
            2. Time zones
            3. Date and time formats
        10. Web services
          1. RSS publishing
        11. Summary
      9. 9. Users and Access Control
        1. Users and roles
        2. Permissions
          1. Typical roles
          2. A typical scenario
          3. Creating user accounts
          4. User ID 1
          5. Editing accounts
          6. Taking control of the People page
        3. Summary
      10. 10. Optional Features
        1. Activity Tracker
        2. Aggregator
        3. Ban
        4. Book
        5. Forum
          1. Containers
          2. Forum settings
            1. Hot topics
            2. Topics per page
            3. Default order
          3. Forum permissions
          4. Contributing Forum topics
        6. Responsive image
        7. Statistics
        8. Syslog
        9. Core (experimental), Multilingual, and Web services
        10. Summary
      11. 11. Reports
        1. Accessing reports
        2. Available updates
        3. Recent log messages
          1. Log details
          2. Filtering log messages
          3. Clearing logs
          4. Log messages and performance
        4. Field list
        5. Status report
        6. Top 'access denied' errors
        7. Top 'page not found' errors
        8. Top search phrases
        9. Views plugins
        10. Summary
      12. 12. Extending Drupal
        1. Installing a module
        2. Improving FAQs
          1. Downloading the Views Accordion module
          2. Installing the module through the UI
        3. Pathauto and Token
          1. Generating paths from patterns
          2. Pathauto settings
        4. Summary
      13. 13. Theming Drupal
        1. What is a theme?
        2. Terminology
        3. Themes included in Drupal 8
          1. Accessible via the UI
            1. Bartik
            2. Seven
            3. Stark
          2. Base themes
            1. Classy
            2. Stable
        4. Setting the active theme
        5. Common settings
          1. Toggle display
        6. Theme regions
        7. Color scheme
        8. Setting the admin theme
        9. Advanced themes from the Drupal community
          1. Installing a new theme
        10. Custom themes
          1. Base themes and subthemes
        11. Summary
      14. 14. Getting Support
        1. What is open source?
        2. The Drupal community
        3. Drupal.org
        4. Issue queues
          1. Reporting a bug or requesting support
        5. The Drupal security team
        6. api.drupal.org
        7. IRC chat
        8. The Drupal Association
        9. DrupalCon
        10. DrupalCamps
        11. Specialist Drupal companies
        12. Training
        13. Certification
        14. Summary
    6. 2. Module 2
      1. 1. Up and Running with Drupal 8
        1. Introduction
        2. Installing Drupal
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Creating a database user and a database
            2. Database prefixes
            3. Downloading and installing with Drush
            4. Security updates
          5. See also
        3. Using a distribution
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Makefiles
            2. Installing with Drush
          4. See also…
        4. Installing modules and themes
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Discovering modules and themes
            2. Module installation
            3. Theme installation
          4. There's more…
            1. Installing a module with Drush
            2. Uninstalling a module
          5. See also…
        5. Using multisites in Drupal 8
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Security concerns
          5. See also…
        6. Tools for setting up an environment
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Acquia Dev Desktop
            2. XAMPP + Bitnami
            3. Kalabox
          5. See also…
        7. Running Simpletest and PHPUnit
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Is run-tests a shell script?
            2. Running Simpletest without Drupal installed
            3. Running specific tests
            4. DrupalCI
          5. See also…
      2. 2. The Content Authoring Experience
        1. Introduction
        2. Configuring the WYSIWYG editor
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Filter module
            2. CKEditor plugins
          5. See also
        3. Adding and editing content
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
            1. Save as draft
            2. Pathauto
            3. Bulk moderation
          5. See also
        4. Creating a menu and linking content
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Managing a contents menu link from its form
        5. Providing inline editing
          1. How to do it…
          2. How it works…
        6. Creating a custom content type
          1. How to do it…
          2. How it works…
        7. Applying new Drupal 8 core field types
          1. Getting ready
          2. How to do it…
            1. Link
            2. The e-mail field
            3. The Telephone field
            4. Date
            5. The Entity Reference
          3. How it works…
          4. There's more…
            1. Upcoming updates
            2. Views and Entity Reference
          5. See also
        8. Customizing the form display of a node
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Managing form display modes
            2. Programmatically providing a default to hidden form items
          4. See also
        9. Customizing the display output of a node
          1. How to do it…
          2. How it works…
      3. 3. Displaying Content through Views
        1. Introduction
        2. Listing content
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Views in Drupal Core Initiative
            2. Views and displays
            3. Format style plugins: style and row
            4. Using the Embed display
          5. See also
        3. Editing the default admin interfaces
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Exposed versus non-exposed
            2. Filter identifiers
            3. Overriding routes with Views
        4. Creating a block from a View
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Exposed forms as blocks
          5. See also
        5. Utilizing dynamic arguments
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Previewing with contextual filters
            2. Displaying as a tab on the user page
            3. Altering the page title
            4. Validation
            5. Multiple and exclusion
        6. Adding a relationship in a View
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Relationships provided by entity reference fields
            2. Relationships provided through custom code
            3. Using Aggregation and views.
        7. Providing an Entity Reference result View
          1. How to do it…
          2. How it works…
          3. There's more…
            1. View arguments
          4. See also
      4. 4. Extending Drupal
        1. Introduction
        2. Creating a module
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Module namespaces
            2. Module discovery locations
            3. Defining a package group
            4. Module dependencies
            5. Specifying the module's version
          4. See also...
        3. Defining a custom page
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Parameters in routes
            2. Validating parameters in routes
            3. Route requirements
            4. Providing dynamic routes
            5. Altering existing routes
          5. See also
        4. Defining permissions
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more…
            1. Restrict access flag for permissions
            2. Defining permissions programmatically
            3. Checking whether a user has permissions
        5. Providing the configuration on installation or update
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Configuration subdirectories
            2. Modifying the existing configuration on installation
          5. See also
        6. Using Features 2.x
          1. How to do it...
          2. How it works…
          3. There's more…
            1. Suggested feature modules
            2. Features bundles
            3. Managing the configuration state of Features
          4. See also
      5. 5. Frontend for the Win
        1. Introduction
        2. Creating a custom theme based on Classy
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Theme screenshots
            2. Themes, logos, and favicons
            3. Base themes and shared resources
            4. CKEditor stylesheets
          4. See also
        3. Using the new asset management system
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
            1. CSS groups
            2. Library asset options
            3. Library dependencies
            4. Overriding and extending other libraries
            5. Using a CDN or external resource as a library
            6. Manipulating libraries from hooks
            7. Placing JavaScript in the header
          5. See also
        4. Twig templating
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
            1. Security first
            2. Theme hook suggestions
            3. Debugging template file selection and hook suggestions
            4. The Twig logic and operators
          5. See also
        5. Using the Breakpoint module
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Caveat for providing breakpoints from themes
            2. Accessing breakpoints programmatically
            3. Multipliers
          5. See also
        6. Using the Responsive Image module
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Performance first delivery
            2. Removing picturefill polyfill
          5. See also
      6. 6. Creating Forms with the Form API
        1. Introduction
        2. Creating a form
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Form element definitions
            2. The form state
            3. The form cache
          5. See also
        3. Using new HTML5 elements
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Specific element properties
            2. Creating new elements
          5. See also
        4. Validating form data
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Multiple validation handlers
            2. Accessing multidimensional array values
            3. Element validation methods
        5. Processing submitted form data
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Multiple submit handlers
          5. See also
        6. Altering other forms
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Adding additional validate handlers
            2. Adding additional submit handlers
      7. 7. Plug and Play with Plugins
        1. Introduction
        2. Creating blocks using plugins
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more...
            1. Altering blocks
            2. Block settings forms
            3. Defining access to a block
          5. See also
        3. Creating a custom field type
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Altering field types
            2. Defining whether a field is empty
          5. See also
        4. Creating a custom field widget
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more
            1. Field widget settings and summary
          5. See also
        5. Creating a custom field formatter
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
            1. Formatter settings and summary
          5. See also
        6. Creating a custom plugin type
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
            1. Specifying an alter hook
            2. Using a cache backend
            3. Accessing plugins through the manager
          5. See also
      8. 8. Multilingual and Internationalization
        1. Introduction
        2. Translating administrative interfaces
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Manually installing language files
            2. Checking translation status
            3. Exporting translations
            4. Interface translation permissions
            5. Using interface translation to customize default English strings
            6. Interface text language detection
            7. Providing translations for a custom module
          5. See also
        3. Translating configuration
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Altering configuration translation info definitions
            2. Translating views
          5. See also
        4. Translating content
          1. Getting ready
          2. How to do it…
          3. How it works
          4. There's more
            1. Flagging translations as outdated
            2. Translating content links
            3. Defining translation handlers for entities
          5. See also
        5. Creating multilingual views
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Translating exposed form items and filters
            2. Translating display and row format items
            3. Translating page display menu items
          5. See also
      9. 9. Configuration Management – Deploying in Drupal 8
        1. Introduction
        2. Importing and exporting configurations
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Configuration dependencies
            2. Saving to a YAML file for a module's configuration installation
            3. Configuration schemas
          5. See also
        3. Synchronizing site configurations
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Universally Unique Identifier
            2. A synchronization folder
            3. Installing a configuration from a new site
        4. Using command-line workflow processes
          1. Getting ready…
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Drush config-pull
            2. Using the Drupal Console
            3. Editing the configuration from the command line
            4. Exporting a single configuration item
            5. Using version control and command-line workflow
          5. See also
        5. Using the filesystem for configuration storage
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Deprecated for Drupal 9
          4. See also
      10. 10. The Entity API
        1. Introduction
        2. Creating a configuration entity type
          1. Getting ready
          2. How to do it…
          3. How it works
          4. There's more…
            1. Available data types for schema definitions
          5. See also
        3. Creating a content entity type
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Using the AdminHtmlRouteProvider provider
            2. Simplifying base field definitions using the Entity module
            3. The entity type's admin permission
            4. Making the collection route a local task tab
          5. See also
        4. Creating a bundle for a content entity type
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Provide action links for adding new bundles
          5. See also
        5. Implementing custom access control for an entity
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Controlling access to entity fields
          5. See also
        6. Providing a custom storage handler
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Utilizing a different storage backend for an entity
          5. See also
        7. Creating a route provider
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. The Entity API module provides add generation
            2. Providing a collection route
          5. See also
      11. 11. Off the Drupalicon Island
        1. Introduction
        2. Implementing and using a third-party JavaScript library
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Implementing and using a third-party CSS library
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Implementing and using a third-party PHP library
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Using Composer manager
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Updating the Stack/Cors recipe
          5. See also
      12. 12. Web Services
        1. Introduction
        2. Enabling RESTful interfaces
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Soft dependency on the HAL module
            2. RestResource plugin to expose data through RESTful Web Services
            3. The REST UI module
            4. Rate limiting your API
          5. See also
        3. Using GET to retrieve data
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Using _format instead of the Accept header
          5. See also
        4. Using POST to create data
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Understanding available _links requirements
            2. Working with images
            3. Using Cross-Site Request Forgery tokens
          5. See also
        5. Using PATCH to update data
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Using Views to provide custom data sources
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Controlling the key name in JSON output
            2. Controlling access of RESTful Views
            3. Add a URL formatter for the image field
          4. See also
        7. Authentication
          1. Getting ready
          2. How to do it…
          3. There's more…
            1. Authentication provider services
            2. Page cache request policies and authenticated web service requests
            3. IP Authentication Provider
          4. See also
      13. 13. The Drupal CLI
        1. Introduction
        2. Rebuilding cache in Console or Drush
          1. How to do it…
          2. How it works…
        3. Using Drush to interact with the database
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Using gzip with sql-dump
            2. Using Console to interact with the database
          5. See also
        4. Using Drush to manage users
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Advanced user-login use cases
            2. Using Drupal Console
        5. Scaffolding code through Console
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Making a Drush command
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Specifying the level of Drupal's bootstrap
          5. See also
        7. Making a Console command
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Using a Console command to create entities
          5. See also
    7. 3. Module 3
      1. 1. Setting Up Our Development Environment
        1. Installing an AMP (Apache, MySQL, PHP) stack
          1. Introducing MAMP
          2. Downloading MAMP
          3. Installing MAMP
        2. A quick tour of MAMP PRO
          1. General settings for MAMP PRO
          2. Host settings
        3. Installing Drupal 8
          1. Downloading Drupal 8
            1. Creating our document root
            2. Creating our host entry
          2. Creating a new database for Drupal
            1. Using phpMyAdmin
          3. Completing Drupal 8 installation
            1. Choosing a language
            2. Choosing a profile
            3. Verifying requirements
            4. Database configuration
            5. Configuring the site
            6. Site maintenance account
            7. Regional settings
            8. Update notifications
        4. Reviewing the new admin interface
          1. Exploring the admin menu
          2. Previewing the interface
          3. Exploring Drupal 8 folder structure
            1. The core folder
            2. The modules folder
            3. The sites folder
            4. The themes folder
        5. Using the project files
          1. Downloading and extracting the exercise files
          2. Database backup
            1. Export settings
          3. Database restore
          4. Using Google Chrome to inspect elements
        6. Summary
      2. 2. Theme Administration
        1. What is a theme?
        2. Exploring the Appearance interface
        3. Drupal's core themes
          1. Bartik
          2. Seven
          3. Stark
          4. Classy
        4. Theme states
          1. Installed themes
          2. Uninstalled themes
          3. Default theme
        5. Installing and uninstalling themes
          1. Step one – installing a theme
          2. Step two – uninstalling a theme
        6. Theme settings
          1. Toggling the display of page elements
          2. Logo image settings
          3. Shortcut icon settings
        7. Theme-specific settings
        8. Using prebuilt themes
          1. Installing a new theme
            1. Installing from a URL
            2. Uploading a module or theme archive to install
        9. Manually installing a theme
        10. Cleaning up our themes folder
        11. Managing content with blocks
          1. Exploring the Block layout
          2. Blocks and regions
          3. Demonstrating block regions
          4. Placing blocks into regions
          5. Configuring a block
            1. Managing the title
          6. Managing visibility settings
            1. Content types restriction
            2. Page restriction
            3. Role restriction
          7. Creating a custom block
        12. Managing custom blocks
          1. Exploring the custom block library
          2. Exploring block types
          3. Managing fields
          4. Managing display
        13. Summary
      3. 3. Dissecting a Theme
        1. Setting up a local development environment
          1. Managing sites/default folder permissions
          2. Configuring settings.local.php
            1. Disabling CSS and JS aggregation
            2. Disabling render and page cache
            3. Disabling test modules and themes
        2. Default themes versus custom themes
        3. Folder structure and naming conventions
        4. Managing configuration in Drupal 8
        5. Reviewing the new info.yml file
          1. Metadata
          2. Libraries
            1. Defining a library
              1. Overriding libraries
              2. Extending libraries
            2. Attaching a library
              1. Using Twig to attach a library
              2. Using the preprocess functions to attach a library
          3. Regions
        6. The role of templates in Drupal
          1. How templates work
          2. Where to find templates
        7. Creating our first basic theme
          1. Step One – creating a new folder
          2. Step two – create an info file
          3. Step three – copy core templates
          4. Step four – include a screenshot
          5. Step five – installing our theme
          6. Step six – Welcome to Twig
        8. Introducing Twig
          1. Enabling Twig debug
          2. Twig fundamentals
            1. Commenting variables
            2. Setting variables
            3. Printing variables
            4. Dumping variables
            5. Filters
            6. Control structures
        9. Template variables
        10. The role of the theme file in Drupal
          1. Preprocessors and hooks
          2. Overriding variables
        11. Summary
      4. 4. Getting Started – Creating Themes
        1. Starter themes
        2. Creating a Bootstrap starter
          1. Understanding grids and columns
          2. Setting up a theme folder
          3. Adding a screenshot
          4. Configuring our theme
          5. Installing our theme
          6. Working with libraries
            1. Adding assets
            2. Creating a library reference
            3. Including our library
        3. Creating a Jumbotron
          1. Step one – managing block content
          2. Step two – hiding the page title
        4. Rethinking our layout
          1. Adding regions
          2. Managing the block content
        5. Using Twig templates
          1. Creating a homepage template
          2. Creating region templates
          3. Working with the Theme layer
          4. Using Devel to print variables
            1. Printing variables from a function
        6. Subthemes
          1. Adding the theme folder
          2. Including a screenshot
          3. Configuring our theme
          4. Installing our theme
        7. Touring Classy
          1. Overriding a library
        8. Summary
      5. 5. Prepping Our Project
        1. Walking through the design mockup
          1. Homepage layout
            1. Defining homepage regions and user interaction
          2. Basic page layout
            1. Defining interior regions
          3. Landing page layout
          4. Blog detail layout
          5. Contact page
          6. Search results
        2. Restoring our database snapshot
        3. Creating a custom theme
          1. Setting up theme folders
          2. Adding a screenshot
          3. Creating our configuration file
          4. Installing our theme
          5. Setting up our regions
          6. Setting up our assets
          7. Adding additional assets
          8. Handling default files
        4. Summary
      6. 6. Theming Our Homepage
        1. Creating our HTML wrapper
          1. Introducing web fonts
        2. Creating our homepage
          1. Using page templates
          2. Working with static content
        3. Implementing our Header Top region
          1. Creating our Social Icons block
          2. Installing Font Awesome library
          3. Refactoring Header Top region
        4. Implementing our Header region
          1. Adding a logo
          2. Enabling Site branding
          3. Printing our Header region
          4. Creating Block templates
          5. Implementing our search form block
          6. Placing our search form block
          7. Creating a search form block template
          8. Adding custom JavaScript
          9. Creating an input element template
          10. Working with menus
          11. Creating a menu template
          12. Creating System Menu block template
          13. Creating a sticky header
        5. Implementing our Headline Region
          1. Creating our Headline View and Block
          2. Adding our Headlines Block
          3. Printing our Headline region
          4. Configuring FlexSlider library
          5. Attaching a library using Twig
          6. Enable FlexSlider
          7. Implementing Parallax
          8. Adding a scroll effect
          9. Enabling the scroll script
          10. Attaching ScrollTo library using Twig
        6. Implementing our Before Content region
          1. Creating our Services block
          2. Creating our Features block
          3. Refactoring Before Content region
        7. Implementing the footer
          1. Creating our custom blocks
          2. Refactoring our main footer
            1. Footer first
            2. Footer second
            3. Footer third
            4. Footer bottom left
            5. Footer bottom right
        8. Summary
      7. 7. Theming Our Interior Page
        1. Reviewing the About Us mockup
        2. Creating our interior page template
        3. Adding our Global Header
        4. Implementing our page title
          1. Working with static HTML
          2. Adding new regions
          3. Reassigning the Page title block
          4. Printing the Title Bar region
          5. Creating a block template
        5. Implementing our main page structure
          1. Creating a Node template
        6. Implementing our Team members section
          1. Prepping our Team Member View
          2. Creating our Team Member View
          3. Managing our Team Members listing block
          4. Formatting Views with CSS
          5. Adding CSS classes to Views
          6. Using Twig variables to rewrite field content
          7. Rearranging View fields
          8. Adding a View header
          9. Refactoring the After Content region
        7. Adding our global footer
        8. Fixing JavaScript errors
        9. Summary
      8. 8. Theming Our Blog Listing Page
        1. Reviewing the Blog Listing mockup
        2. Creating our blog listing
          1. Adding a new display mode
          2. Managing the display
            1. Enabling fields
            2. Field label visibility
            3. Formatting fields
        3. Creating a Post Listing view
          1. Using Content Display modes with views
        4. Managing our Post Listing block
        5. Implementing our Node template
          1. Adding CSS classes to Twig
          2. Working with content variables
          3. Using the without filter
          4. Creating our post image slider
          5. Working with field templates
          6. Adding the Owl Carousel library
          7. Using Twig filters for dates
          8. Printing title and teaser
          9. Creating our post metadata
          10. Field templates and taxonomy
          11. Handling comments in Drupal 8
        6. Creating a theme file
          1. Printing our comment count
          2. Adding a read more link
        7. Creating a Categories block
        8. Managing our Categories block
        9. Implementing responsive sidebars
        10. Theming a Block template
        11. Drupal Views and Twig templates
        12. Managing popular versus recent content
          1. Creating our recent posts block
          2. Creating our popular posts block
          3. Sorting views by comment count
          4. Attaching a view to the footer
          5. Managing our popular posts block
          6. Using Twig and Bootstrap tabs
            1. Recent Posts Twig template
            2. Popular Posts Twig template
          7. Using Views-view templates
          8. Creating a Post Teaser Twig template
        13. Adding the About Us block
          1. Implementing the About Us template
        14. Summary
      9. 9. Theming Our Blog Detail Page
        1. Reviewing the Blog detail mockup
        2. Previewing our Blog detail page
        3. Creating a Post Full template
          1. Altering fields
        4. Working with comments
          1. Introducing Comment types
          2. Reviewing Default Comment type fields and display
          3. Enabling Post Type Comments field
          4. Creating a Field Comments template
          5. Theming the Comment thread
          6. Enabling user photos for Comment threads
          7. Cleaning up the User Picture field
            1. Creating the Field User Picture template
          8. Date and time formats
        5. Implementing social sharing capabilities
          1. The Add This buttons
            1. Creating a library entry
            2. Attaching the library to our Blog detail page
            3. Displaying buttons
        6. Summary
      10. 10. Theming Our Contact Page
        1. Reviewing the contact page mockup
        2. Introducing contact forms
          1. Editing a contact form
          2. Managing form fields
          3. Managing form display
        3. Contact page layout
        4. Adding a Callout block
          1. Creating the Callout block template
        5. Integrating Google Maps into our contact page
          1. Configure Google Maps
          2. Creating our Google Maps block
          3. Creating the Callout Map template
        6. Summary
      11. 11. Theming Our Search Results
        1. Reviewing the Search Results mockup
        2. Looking at default Search results
        3. Introducing core search
          1. Indexing content
          2. Editing search pages
            1. Disabling search pages
        4. Working with Search Results templates
          1. Modifying the item list template
          2. Cleaning up each result
        5. Search alternatives
          1. Search API
            1. Installing the Search API
          2. Adding a server
          3. Adding an index
            1. Configuring bundles
            2. Adding fields to our index
          4. Creating a Search Results View
            1. Using the Search index view mode
            2. Adding filter criteria
            3. Placing our exposed search form
            4. Adding our placeholder attribute
          5. Using our search form
            1. Displaying the number of search results
            2. Adding a No Results message
        6. Summary
      12. 12. Tips, Tricks, and Where to Go from Here
        1. Working with Local Tasks
          1. Theming local tasks
          2. Working with Status messages
            1. Adding the Highlighted region
            2. Theming our Status message block
        2. Reusing Twig templates
          1. Using extends to share layouts
          2. Working with Twig blocks
        3. Where do we go from here?
        4. Summary
    8. A. Biblography
    9. Index