Introduction to Drupal 8
Aditya Ghan
Aditya Ghan
Solution Architect
DrupalCon Los Angeles 2015
DrupalCon Asia 2016
DrupalCon New Orleans 2016
Trainings - The mighty
“Why?”
• Personal Growth, long term
plan and value
• Adopt new technologies,
practices, policies early.
• Stay Relevant in a fast
changing tech world.
What’s different this
time?
What’s different this time?
• Consolidate all fragments of trainings going on
right now into one.
• Standardise the bare minimums. (PPT,
Documentation, Exercises & Assets)
• A standard structure, making it repeatable,
trackable, and person independent.
Introduction to Drupal 8
Aditya Ghan
Agenda
• Drupal 8 Overview
• Drupal 8 for Developers
• Drupal 8 for Site Builders
• Drupal 8 for Mobile
Drupal 8
• It’s the new Drupal
• Latest Stable Version - 8.2
• Very different than Drupal 7,
much evolved
Inspiration behind Drupal 8
We’re on a island of Drupalisms!
Drupalisms
$bigassobject->blah[0][‘blu’][‘bla’]->blah->balle[0]
More Drupalisms
• Minimum OOP support
• Hooks
Drupal 8 for Developers
Understanding Drupal
releases
• Always use a recommended release when starting
a project.
• Current Release is 8.2.5
• A new minor release would be made every 6
months (Drupal 8.0.x, 8.1.x, 8.2.x, and so on)
• Each Minor release will have some experimental
modules for developers to test and give
feedbacks
Understanding Drupal
releases
• Each minor release has minor updates within it
(8.2.5 to 8.2.6 etc)
• Guide to update Drupal 8 core: https://
www.drupal.org/docs/8/update/update-
procedure-in-drupal-8
• Exercise caution when updating from one minor
release to another (Eg: 8.1.x to 8.2.x)
D8 Vocabulary
Enter Drupal 8
• The leading PHP framework to
create websites and web
applications.
• Drupal 8 uses many Symfony
components such as
HttpFoundation, HttpKernel,
Routing, EventDispatcher
• YAML is a human friendly data
serialisation standard for all
languages.
• Drupal uses YAML to store
lists and data where
computations are not needed
• YAML is used to define Info
files, routes, services etc
• Composer is a dependency
manager for PHP.
• It allows you to declare the
libraries your project depends
on and it will manage (install/
update) them for you.
• composer install
• composer update
• composer.json
• vendor
• “Twig” is a fast, secure,
flexible template engine for
PHP applications.
• Twig has it’s own syntax for
writing templates. Finally, the
twig template is converted into
PHP templates.
• https://www.drupal.org/docs/8/
theming/twig/comparison-of-
phptemplate-and-twig-
theming-paradigms
Dependency Injection
• Makes sense in Object Oriented Programming
• It’s a design pattern for efficient injection of
services in your code.
Dependency Injection
• “If an object A depends on the object of type B,
the object A won’t explicitly instantiate the object
B but rather will get it injected from the
operational environment”
Dependency Injection
Class A Class B
Uses Class A Object
Class B is dependent on an object of Class A
Dependency Injection
Using NEW Keyword
Dependency Injection
• Drupal follows PSR-4 standards
• It’s a system where we define PHP classes in a specific way so we
could autoload them efficiently when required.
• Demo
Namespaces and
Autoloading
Namespace Mapping
Level Namespace Path
Vendor Drupal drupal_root
Module Drupalmodule_name
drupal_root/module_name/
src
Sub Folder
Drupalmodule_namefolder_
name
drupal_root/module_name/
src/folder_name
• Started from the CMI initiative
• Almost all configuration could be tracked via code!
• Drupal 8.2 has experimental feature to track and deploy content!
• Demo
Configuration Management
Configuration Management
• Web services in core!
• Views + REST Export = Cool Combination.
• Demo
Web Services
• Multilingual First
• Multilingual configuration is easy and requires less modules
• Everything is translatable! (Content, Blocks, Views, Menus, Fields)
• Transliteration support (for special characters)
• Demo
Multilingual Support
Front-end Improvements
• HTML5
• schema.org output
• New Front-end libraries (Modernizr,
Underscore.js, Backbone.js)
• No IE6, IE7, IE8 etc
Drupal 8 for Site Builders
Drupal 8 for Site Builders
• Spark
• WYSIWYG Editor
• In-place Editing
• Content Moderation and Revisioning
• Mobile Improvements
SPARK
WYSIWYG Editor
In-Place Editing
Content Moderation and Revisioning
More features…
• Views in Core
• Better Blocks
• More field types
• Form Modes
Drupal 8 for Mobile
Drupal 8 for Mobile
• Mobile First
• Out-of-the-box responsive
• Mobile Friendly toolbar
• Improved Front-end performance on Mobile
Mobile Improvements
Enter Drupal 8!
Moving Forward
• Target one training of your practice every month.
• A lead for every practice we run.
• Find a speaker, give him at least 1 month’s
notice to prep.
• Monthly meeting of the leads, reporting directly
to Engineering Manager & Delivery Head.
What’s next?
• Drupal 8 Module Development
• Drupal 8 Theming
• Upgrading D7 modules to D8
• Symfony
• Anything else?
Who and When?
• Volunteer for an training!
• Showcase your talent!
• Improve your communication skills!
• Be ready for Drupalcamps and Drupalcons!
• Anything else?
Thank you!

Drupal 8 introduction

  • 2.
  • 3.
    Aditya Ghan Solution Architect DrupalConLos Angeles 2015 DrupalCon Asia 2016 DrupalCon New Orleans 2016
  • 4.
    Trainings - Themighty “Why?” • Personal Growth, long term plan and value • Adopt new technologies, practices, policies early. • Stay Relevant in a fast changing tech world.
  • 5.
  • 6.
    What’s different thistime? • Consolidate all fragments of trainings going on right now into one. • Standardise the bare minimums. (PPT, Documentation, Exercises & Assets) • A standard structure, making it repeatable, trackable, and person independent.
  • 8.
  • 9.
    Agenda • Drupal 8Overview • Drupal 8 for Developers • Drupal 8 for Site Builders • Drupal 8 for Mobile
  • 10.
    Drupal 8 • It’sthe new Drupal • Latest Stable Version - 8.2 • Very different than Drupal 7, much evolved
  • 11.
  • 12.
    We’re on aisland of Drupalisms!
  • 13.
  • 14.
    More Drupalisms • MinimumOOP support • Hooks
  • 15.
    Drupal 8 forDevelopers
  • 16.
    Understanding Drupal releases • Alwaysuse a recommended release when starting a project. • Current Release is 8.2.5 • A new minor release would be made every 6 months (Drupal 8.0.x, 8.1.x, 8.2.x, and so on) • Each Minor release will have some experimental modules for developers to test and give feedbacks
  • 17.
    Understanding Drupal releases • Eachminor release has minor updates within it (8.2.5 to 8.2.6 etc) • Guide to update Drupal 8 core: https:// www.drupal.org/docs/8/update/update- procedure-in-drupal-8 • Exercise caution when updating from one minor release to another (Eg: 8.1.x to 8.2.x)
  • 18.
  • 19.
  • 20.
    • The leadingPHP framework to create websites and web applications. • Drupal 8 uses many Symfony components such as HttpFoundation, HttpKernel, Routing, EventDispatcher
  • 21.
    • YAML isa human friendly data serialisation standard for all languages. • Drupal uses YAML to store lists and data where computations are not needed • YAML is used to define Info files, routes, services etc
  • 22.
    • Composer isa dependency manager for PHP. • It allows you to declare the libraries your project depends on and it will manage (install/ update) them for you.
  • 23.
    • composer install •composer update • composer.json • vendor
  • 24.
    • “Twig” isa fast, secure, flexible template engine for PHP applications. • Twig has it’s own syntax for writing templates. Finally, the twig template is converted into PHP templates. • https://www.drupal.org/docs/8/ theming/twig/comparison-of- phptemplate-and-twig- theming-paradigms
  • 26.
    Dependency Injection • Makessense in Object Oriented Programming • It’s a design pattern for efficient injection of services in your code.
  • 27.
    Dependency Injection • “Ifan object A depends on the object of type B, the object A won’t explicitly instantiate the object B but rather will get it injected from the operational environment”
  • 28.
    Dependency Injection Class AClass B Uses Class A Object Class B is dependent on an object of Class A
  • 29.
    Dependency Injection Using NEWKeyword Dependency Injection
  • 30.
    • Drupal followsPSR-4 standards • It’s a system where we define PHP classes in a specific way so we could autoload them efficiently when required. • Demo Namespaces and Autoloading
  • 32.
    Namespace Mapping Level NamespacePath Vendor Drupal drupal_root Module Drupalmodule_name drupal_root/module_name/ src Sub Folder Drupalmodule_namefolder_ name drupal_root/module_name/ src/folder_name
  • 34.
    • Started fromthe CMI initiative • Almost all configuration could be tracked via code! • Drupal 8.2 has experimental feature to track and deploy content! • Demo Configuration Management
  • 35.
  • 36.
    • Web servicesin core! • Views + REST Export = Cool Combination. • Demo Web Services
  • 37.
    • Multilingual First •Multilingual configuration is easy and requires less modules • Everything is translatable! (Content, Blocks, Views, Menus, Fields) • Transliteration support (for special characters) • Demo Multilingual Support
  • 38.
    Front-end Improvements • HTML5 •schema.org output • New Front-end libraries (Modernizr, Underscore.js, Backbone.js) • No IE6, IE7, IE8 etc
  • 39.
    Drupal 8 forSite Builders
  • 40.
    Drupal 8 forSite Builders • Spark • WYSIWYG Editor • In-place Editing • Content Moderation and Revisioning • Mobile Improvements
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
    More features… • Viewsin Core • Better Blocks • More field types • Form Modes
  • 46.
  • 47.
    Drupal 8 forMobile • Mobile First • Out-of-the-box responsive • Mobile Friendly toolbar • Improved Front-end performance on Mobile
  • 48.
  • 49.
  • 50.
    Moving Forward • Targetone training of your practice every month. • A lead for every practice we run. • Find a speaker, give him at least 1 month’s notice to prep. • Monthly meeting of the leads, reporting directly to Engineering Manager & Delivery Head.
  • 51.
    What’s next? • Drupal8 Module Development • Drupal 8 Theming • Upgrading D7 modules to D8 • Symfony • Anything else?
  • 52.
    Who and When? •Volunteer for an training! • Showcase your talent! • Improve your communication skills! • Be ready for Drupalcamps and Drupalcons! • Anything else?
  • 53.