What is new in 

Drupal 8

by Nguyen Tien Si

Agenda

  1. Configuration Management
  2. Web Services
  3. Multilingual
  4. Views in Core
  5. HTML5
  6. Mobile
  7. Layout
  8. Others

Drupal 7

  1. Overlay
  2. UI fixes
  3. New Database API
  4. Tests (30k + test cases)
  5. Field API (D6: CCK)

1. Configuration Management

Drupal 7: Deploy from Dev to Pro, including:
  • Update_N() hook
  • Features module
  • Ctools export

Drupal 8:  Exporting the configuration to the file system as YAML files

1. Configuration Management

  • File storage: YAML (http://www.yaml.org)
  • Directory:
    • active (sites/example.com/files/config_xxx/active)
    • staging (sites/example.com/files/config_xxx/staging)
  • API:
    • Old (D7): variable_set()/variable_get()
    • New (D8): $config->set()/$config->get()

$config = config('foo.bar');
$config->set('foo', 'foo');
$config->set('bar', 'bar');
$config->save();

1. Configuration Management

  1. Configuration exportExport your site configuration
  2. Configuration importImport configuration for your site
  3. Synchronize configurationSynchronize configuration changes.


2. Web Services

Drupal 7: restws, services module
Drupal 8: rest module based on sf2, guzzle/http component.
  • HTTP Methods: POST (create), PUT (update), GET (request), DELETE (delete)
  • Response formats: JSON-LD, JSON, XML

Now Drupal 8 can output data as non-HTML and HTML (support HTML5).

3. Multilingual

Drupal 7: many of the i18n modules, over 20+ modules
Drupal 8: language, translation_entity, locate (interface translate) modules (alpha2).
  • Configure languages.
  • Translate content entities.
  • Translates the built-in user interface.

4. Views in Core

Drupal 7: Views is a contrib module, many site use it.
Drupal 8: Views in Core
  • A bulk actions checkbox
  • A dropbutton field handler
  • Core token support
  • REST support and serializer integration
  • A "clone as" feature (to clone a page display into a block display, etc.)
  • Responsive (mobile-friendly) Views administration

4. VIEWS IN CORE


5. HTML5

  • Support for the new form elements to Drupal’s Form API.
  • New semantic elements in core templates.
  • Adding ARIA roles to markup to improve accessibility.
  • CSS cleanup.
  • JavaScript fallback for HTML5 elements in non-supported browsers.

5. HTML5

source: drupalwatchdog.com

6. Mobile

Mobile solutions:
  • Native apps
  • Web apps
  • Mobile/desktop domain switching
  • Reponsive design
Drupal support:
  • Web services for native app
  • HTML5 for HTML5 web apps
  • Drupal’s administrative forms
  • All of Drupal 8’s core themes should be responsive

6. Mobile


7. Layout

Blocks
  • Convert all blocks into Plugins
  • Depends on CMI
  • Convert primary and secondary menus to blocks.

7. Layout

Layout
  • Responsive layout
  • New template engine (Twig)
  • Inline-edit
  • New create content page

7. Layout


8. Others

  • Entity API to core
  • Many field type to core, ex: email, link, entity reference, phone
  • Blocks became plugins
  • Custom blocks are now content entities, in separate module.
  • Garland theme has been removed from core
  • PSR-0 compatible class loader in core
  • Node module is now optional
  • Trigger module has been removed from core
  • Use Dependency Injection to handle global PHP objects
  • Core request handling system ported to Symfony2 framework
  • $_GET['q'] removed; must use current_path()

8. Others

  • UUID support added for all core entities
  • Form API now allows for object methods as callbacks
  • Use Composer to handle Drupal Core PHP dependencies
  • Field formatters are now plugins
  • The {system} table has been removed
  • New Datetime API
  • Toolbar module responsive layout update and API to add control structures
  • New Diff library in core
  • User picture have been converted to image field
  • Dialog API for JavaScript

8. Others

See more:
https://drupal.org/list-changes

Question?


What is new in Drupal 8

By Nguyen Tien Si

What is new in Drupal 8

  • 1,020