Top 8 Improvements in Drupal 8

8,917 views

Published on

Walks through the top 8 improvements coming to Drupal 8, including videos and code samples to demonstrate "before vs. after."

Given to the @DrupalNS meet up in Bedford, Nova Scotia on July 28, 2014.

Published in: Software
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,917
On SlideShare
0
From Embeds
0
Number of Embeds
1,436
Actions
Shares
0
Downloads
60
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide
  • @TODO: Obviously, put your stuff instead. :)
    I work at Acquia in the Office of the CTO; Dries is my boss. :)
    Very focused on community stuff, such as making Drupal core, Drupal.org, and the Drupal Association rock!
    I’m also one of the authors of the O’Reilly book Using Drupal (give shout-out to Bruno), which covers all the key contributed modules worth knowing about; just updated for Drupal 7.
  • Here we see the default Drupal 7 authoring experience.
    I like to call this video "why people say WordPress before Drupal" ;)
  • Redesigned content page
  • No more 1 block in only 1 region in each theme limitation
    Context system for blocks
    Fieldable custom block types, analogous to content types
  • Top 8 Improvements in Drupal 8

    1. 1. The Top 8 Improvements Coming To Drupal 8 Angie "webchick" Byron Nova Scotia Drupal Meetup July 28, 2014
    2. 2. About me
    3. 3. What are we doing here tonight? • Go through top 8 changes for Drupal 8, in order of meekness. ;) • Walk through some of the bigger API changes in D8 for module developers • Talk about when D8 is coming and how you can help
    4. 4. 1. Improved Authoring Experience
    5. 5. Drupal 7
    6. 6. Drupal 8
    7. 7. Drupal 7
    8. 8. Drupal 8
    9. 9. 2. Mobile First
    10. 10. Drupal 7
    11. 11. Drupal 8
    12. 12. Drupal 8
    13. 13. 3. Site Builder Improvements
    14. 14. Views in Core!
    15. 15. Better Blocks
    16. 16. New Field Types
    17. 17. 4. Multilingual++
    18. 18. Drupal 8
    19. 19. Translatable Everything! • Content • Blocks • Menus • User Profiles • Taxonomy • Views • Image styles • Text formats • Comments • Feeds • …and more! • No contrib modules needed!
    20. 20. 5. Configuration Management
    21. 21. One core system to solve this mess variable_set()/variable_get() ctools_export_object()/ctool s_export_load_object() db_select()/db_update()/d b_delete() $conf[...]; hook_update_N() drush fu
    22. 22. 6. Twig & HTML5
    23. 23. PHPTemplate is now Twig7.x: page.tpl.php 8.x: page.html.twig <div id="page-wrapper"> <div id="page"> <div id="header"> <div class="section clearfix"> <?php if ($logo): ?> <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo"> <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /> </a> <?php endif; ?> <div class="layout-container"> <header role="banner"> {% if logo %} <a href="{{ front_page }}" title="{{ 'Home'|t }}" rel="home"> <img src="{{ logo }}" alt="{{ 'Home'|t }}"/> </a> {% endif %} • Friendlier syntax for designers • Variables auto-escaped for better security • Semantic, HTML5 markup http://twig.sensiolabs.org
    24. 24. HTML5 Forms
    25. 25. No more support for IE 6, 7, & 8
    26. 26. 7. Web Services
    27. 27. 8. Modern, OO Code
    28. 28. Warning: Things are about to get... geeky.
    29. 29. "Getting off the Island"
    30. 30. Modern PHP Best Practices • PHP 5.4+ • Classes/Interfaces • Namespaces • Traits • Dependency Injection • Most PSR-* standards
    31. 31. Powered by Symfony2 Tutorial: http://fabien.potencier.org/article/50/create-your-own- framework-on-top-of-the-symfony2-components-part-1
    32. 32. …and dozens of other external libraries
    33. 33. …and dozens of other libraries A peek under the hood
    34. 34. YAML, YAML everywhere 7.x: example.info 8.x: example.info.yml name = Example description = "Example module" core = 7.x files[] = example.test config = admin/config/example dependencies[] = node name: Example type: module description: "Example module" core: 8.x config: admin.example dependencies: - node • New required "type" property • No more files[] (we'll get to that later) • Paths now have machine names (we'll get to that later, too) Drupalism: Kinda- Sorta-INI-Like "Proudly Invented Elsewhere": YAML
    35. 35. Classes, classes everywhere sites/all/modules example ▼ ▼ example.test 7.x modules example ▼ ▼ 8.x src▼ ExampleForm.php ExampleInterface.php ExampleController.php … Pages, forms, blocks, etc. are now all object-oriented.
    36. 36. Defining a page: 7.x function example_menu() { $items['hello'] = array( 'title' => 'Hello world', 'page callback' => '_example_page', 'access callback' => 'user_access', 'access arguments' => 'access content', ); return $items; } function _example_page() { return t('Hello world.'); } example.module Drupalism: "ArrayPIs" ;)
    37. 37. Defining a page: 8.x example.hello: path: '/hello' defaults: _content: 'DrupalexampleExampleController::hello' requirements: _permission: 'access content' example.routing.yml example.links.menu.yml example.hello: title: 'Hello world' route_name: example.hello "Proudly Invented Elsewhere": - SF2 Routing Component - MVC pattern
    38. 38. Defining a page: 8.x <?php namespace Drupalexample; use DrupalCoreControllerControllerBase; /** * Returns responses for Example module routes. */ class ExampleController extends ControllerBase { public function hello() { return array('#markup' => $this->t('Hello world.')); } } src/ExampleController.php "Proudly Invented Elsewhere": - PSR-4 Class Autoloader - OO code
    39. 39. Defining a block: 7.x example.module <?php function example_block_info() { $blocks['example'] = array( 'info' => t('Example block'), ); return $blocks; } function example_block_view($delta = '') { $block = array(); switch ($delta) { case 'example': $block['subject'] = t('Example block'); $block['content'] = array( 'hello' => array( '#markup' => t('Hello world'), ), ); break; } return $block; Drupalism: "Mystery Meat" APIs based on naming conventions
    40. 40. Defining a block: 8.x <?php namespace DrupalexamplePluginBlock; use DrupalblockBlockBase; /** * Provides the Example block. * * @Block( * id = "example", * admin_label = @Translation("Example block"), * category = @Translation("Example") * ) */ class ExampleBlock extends BlockBase { public function build() { return array('hello' => array( '#markup' => $this->t('Hello world.') )); } } src/Plugin/Block/ExampleBlock.php "Proudly Invented Elsewhere": - Annotations - APIs defined by Interfaces
    41. 41. Choose Your Own Data Adventure • While you can do it, it's now considered unusual to store data directly in the database; choose one of the following: • Content Entities: Use for 1000s+ of records; fieldable. Ex: Nodes, Users, Comments, Feeds, Terms • Config Entities: Use for 10s of records; create in UI, deploy. Ex: Views, Text Formats, Image Styles, Vocabularies • Config API: Use for 1s of records; things you want deployed. Ex: most admin/config/foo forms • Settings API: Use for 1s of records; things specific to an environment; not deployed. Ex: timestamps, hashes, keys
    42. 42. Read more about it! Plaster these URLs to your face: https://api.drupal.org/api/drupal/8 https://www.drupal.org/documentation/developer/api
    43. 43. Every API change in Drupal 8 Plaster this URL to your cat's face: https://www.drupal.org/list-changes
    44. 44. Rocket fuel to get started Plaster this URL to your dog's face: https://www.drupal.org/project/drupalmoduleupgrader
    45. 45. 8 sounds great! So where's it at, anyway?
    46. 46. Current Release Status • There are ~100 “critical” issues left to solve that block release. • Of these, ~5 are “beta blockers” that block the beta release. • “Beta” marks the time at which module developers can start re- writing their code on top of Drupal 8. • Without lots of modules being ready, Drupal 8 will not have a successful launch, so we are trying to get beta right. alpha releases bet a RC1 we are here! x “WHEN IT’S READY” (~Q2 2015) https://groups.drupal.org/core/updates
    47. 47. When should I start using it? • Module/Theme developer? • Right now! • Provide early API feedback while things can still be changed. • Early Adopter? • Start building test sites during beta/RC • Be prepared to "BYOBF" (bring your own bug fixes) • Late Adopter? • 6+ months after Drupal 8.0.0 • Wait for enough contrib modules to be ported
    48. 48. What about upgrades? • No more upgrade path; now, migration path. • Build out your Drupal 8 site as a new site, then migrate content, users, etc. over. • Drupal 6 => Drupal 8 migrations already in! • Drupal 7 => Drupal 8 migrations in progress. https://www.drupal.org/upgrade/migrate
    49. 49. What if I'm stuck on D7 for the foreseeable future? Drupal 8 Core Feature Drupal 7 Contrib Equivalent WYSIWYG CKEditor: https://drupal.org/project/ckeditor In-Place Editing Quick Edit: https://drupal.org/project/quickedit Responsive Toolbar “Mobile Friendly Navigation Toolbar" https://drupal.org/project/navbar Responsive Front-End Theme Omega, Zen, Adaptive, etc. base themes Responsive Admin Theme Ember: https://drupal.org/project/ember Responsive Images Picture: https://drupal.org/project/picture Responsive Tables Responsive Tables: https://drupal.org/project/responsive_tables Simplified Overlay Escape Admin: https://drupal.org/project/escape_admin Multilingual Internationalization: https://www.drupal.org/project/i18n Entity Translation: https://www.drupal.org/project/entity_translation Better Blocks Bean: https://www.drupal.org/project/bean
    50. 50. How can I help? • Start porting your modules/themes! • Give "developer experience" feedback while we can still fix things • Help us find/fix holes in documentation • Build a practice site or two • Test out the D6 => D8 migration path! • Find/File bug reports (with patches if you can!) • Help kill critical core issues! :D
    51. 51. Want the full scoop? https://www.drupal.org/drupal-8.0 https://www.acquia.com/tags/ultimate-guide-drupal-8
    52. 52. Thanks! :) Questions?

    ×