Drupal and Us – The new web – For site builders



Drupal and Us – The new web – For site builders

0 0


slides-presenting-drupal-8


On Github Crell / slides-presenting-drupal-8

Drupal and Us

Presented by Larry Garfield (@Crell)

The new web

Personalization

Integrated and Decoupled

Predictive

Data-driven

Push-based

They're not up-front about what they're doing.

  • Push web cannot be just for them
  • Big web for big players
  • Fancy features require big investment

Where does that leave the small player?

  • This is our response. This is our pushback.
  • Community is our secret weapon.
  • Tools built for sharing.
  • Tools like Drupal
The right to innovate is not a privilege to be restricted to a tiny minority

Free Software Magazine, 2005

(A Drupal site, by the way...)

  • Article on OSS in Latin America
  • Open Source is how small players thrive

Who uses Drupal?

We use Drupal

Needs to be approachable

Unusable tools are useless

  • Big changes
  • Big new features
  • Big system requirements
  • Big collaboration
  • Big news

Big sites?

Big shops?

Big companies?

The Point of Open Source is to give everyone big and small access to the same tools on a level playing field.

  • Drupal 8 is the best thing to happen for independent developers
  • Same tools a big enterprise, in your hands.

Drupal 8 is a new generationPHP Platform

  • PHP Renaissance

Drupal 7

PHP 4 architecture

Drupal 8

PHP 5.4 architecture

Drupal 7

Everything is a Page

Drupal 8

Everything is a response

  • Built for web services

Drupal 7

All home grown

Drupal 8

Embrace other communities and tools

Drupal 7

A good start for a CMS

Drupal 8

Build real-world sites right away

For site builders

Build real sites with core

Drupal 7 gave us Field API...

... Drupal 8 expands the toolbox

  • Entity Reference
  • Date
  • Link
  • Email
  • Telephone
Telephone is the last bullet.

Views in core

  • Core blocks and content lists are customizable Views.
  • "Recent comments" block, why custom code/config? Not anymore.

/admin/content

  • admin/content isn't an override, it's the actual view
  • Note VBO-like functionality

Drupal 8

  • Content modeling
  • Content editing
  • Content assembly
  • Content delivery

For everyone, out of the box

  • Save time/money on setup
  • Save time/money on customization

Configuration management

Mixing content and config == Pain

Features: Fail

Poor deployment tool

...Because it's not a deployment tool

Drupal 7 has no common configuration system!

  • How much of your life have you wasted?
  • How much of your client's money have you wasted?
  • Why should only "enterprise" users get good staging?

The new Config API

  • Real configuration API
  • Config import/export built in
  • Modules can include default config
  • Database is now leaner, more contented

Translation in Drupal 7

  • admin_language
  • fallback_language_negotation
  • l10n_install
  • l10n_update
  • entity_translation
  • title
  • variable (suite)
  • i18n (suite)
  • i18nviews
  • webform_localization (et al)
  • stringoverrides
  • transliteration

And it's still incomplete!

Translation in Drupal 8

Deeper, more robust system... in Core

Everyone can buildmulti-lingual sites from day 1

For content editors

Rich editing experience

  • CKEditor built in
  • Automatic configuration, sensible defaults
  • Content editing forms streamlined
  • Easier to use out of the box
  • Easier to use sell of the box
  • Called quick-edit for a reason...
  • Levels playing field for small shops, esp. vs proprietary

No More Overlay

  • Show of hands, who always disabled overlay?
  • We replaced 1000 lines of fugly JS hacks... with a button.
  • JS sessionStorage: Modern browsers

UltraAccessibility

  • 2010, Everett Zufelt presents on accessibility
  • Best accessibility of any OSS platform, but could be better
  • So we made it better...

WAI-ARIA all the things!

Keyboard control

And…

  • Have you ever felt like Drupal was trying to talk to you?
  • Note in-place editor! Ties in with aural support.
  • Devs have access to Drupal.announce() to speak as needed.

All built in and automatic

  • Legal requirement in some areas
  • The right thing to do
  • Reach more people with less effortNot just about disabled users. Mobile phone reads page to you.

…And a new help system

  • Version controlled text files
  • For modules or sites

For themers

Out with the old...

(There's an IE8 module if you really need)

In with the new

  • Everything is responsive out of the box.
  • Semantic elements; header, footer, section, aside, etc.
  • No more silly classes to duplicate CSS3 functionality.
  • New toolbar, prettier than old one, includes shortcuts
  • Modules now "Extend"
  • Small screen, everything responsive!
  • In vertical mode toolbar is nested
  • Can always put toolbar in vertical if you prefer

HTML5 Forms

  • Did anyone notice that we just created a node from a phone???

Lines of Javascript by default: 0

Twig

  • D6: We think themers want this.
  • D7: Maybe they want this instead? (eeek!)
  • D8: OK, OK... what do you want? (TWIG!)
  • Largest team of any task in Drupal 8; lots of themers

node.tpl.php

<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <?php print $user_picture; ?>
  <?php print render($title_prefix); ?>
  <?php if (!$page): ?>
    <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
  <?php endif; ?>
  <?php print render($title_suffix); ?>

  <?php if ($display_submitted): ?>
    <div class="submitted">
      <?php print $submitted; ?>
    </div>
  <?php endif; ?>

  <div class="content"<?php print $content_attributes; ?>>
    <?php
      hide($content['comments']);
      hide($content['links']);
      print render($content);
    ?>
  </div>

  <?php print render($content['links']); ?>
  <?php print render($content['comments']); ?>

</div>
  • Very verbose
  • PHP syntax is a turnoff
  • Easy to make security mistakes (SQL in templates)
{% set classes = [
    'node--type-' ~ node.bundle|clean_class,
    node.isPromoted() ? 'node--promoted',
  ] %}
<article{{ attributes.addClass(classes) }}>
  {{ title_prefix }}
  {% if not page %}
    <h2{{ title_attributes }}>
      <a href="{{ url }}" rel="bookmark">{{ label }}</a>
    </h2>
  {% endif %}
  {{ title_suffix }}

  {% if display_submitted %}
    <div{{ author_attributes.addClass('node__submitted') }}>
      {% trans %}Submitted by {{ author_name|passthrough }} on {{ date|passthrough }}{% endtrans %}
      {{ metadata }}
    </div>
  {% endif %}

  <div{{ content_attributes.addClass('node__content') }}>
    {{ content|without('links') }}
  </div>
  {% if content.links %}
    <div class="node__links">
      {{ content.links }}
    </div>
  {% endif %}
</article>
  • Worry less about security
  • Don't need to know PHP
  • Used by many projects

And one more thing...

Now with 25% fewer divs*

* Compared to the previous leading Drupal.Actual divs may vary by custom theme.Offer void on IE 6.

  • Still a work in progress, esp. Views
  • If you want to help, join Morten's div-elimination army

Under the hood

  • Not just new lang features; new philosophy
  • D7 didn't reinvent for new lang; D8 does
  • Biggest changes are here

PHP 5.4 architecture

  • Interface-driven development
  • Loose coupling
  • "Hack core without hacking core"
  • Fewer Drupalisms

Not Invented Here

Proudly Invented Elsewhere

Proudly Invented Elsewhere

  • Symfony2 Components (HttpFoundation, HttpKernel, DependencyInjection, EventDispatcher, Routing, Serializer, Validator, Yaml)
  • Symfony CMF
  • Zend Feed
  • Doctrine Annotations
  • Guzzle
  • EasyRDF
  • Twig

Plugins

  • ctools plugins, but good
  • Learn once, apply everywhere —Lee Rowlands
  • Interface-driven, self-documenting

Pluginified systems in Drupal 8

  • Actions
  • Blocks
  • Text formats
  • Fields
  • Field Widgets
  • Field Formatters
  • Image effects
  • Conditions
  • Mail backends
  • Archiver
  • Image toolkits
  • Aggregator (Fetcher, Parser, Processor)
  • Editor extensions
  • EntityReference selections
  • Migration
  • REST Resources
  • Search backends
  • Tours
  • All of Views…

Entities/Nodes

Unified API... finally!

  • Fields make sense
  • Nodes/entities are for-reals objects w/ interfaces
  • Field, widgets, formatters are plugins, like everything else
  • Session later today

PHPUnit

  • Industry standard unit testing
  • Blazing fast compared to Simpletest
  • Simpletest still lives... for now
  • If you can't PHPUnit it, you're not done

RESTful pipeline

…HTML is just REST

Not just mobile!

Think server-to-server

Think client-side customization

  • Mobile should be responsive!
  • Syndication
  • Content staging/deployment
  • Data archival

We've gotten off the island

  • Enzo Costa Rica companies story
  • Now can hire more people! (good for small shops)
  • Now can use other projects, too (good for devs)
  • Palantir: Drupal, Symfony, Silex, Sculpin, all Twig!
  • Hear lots of concern, so new, different
  • Inside Drupal and out
  • Ryan Weaver, Sunshine PHP, Drupal as framework

Close the deal

Sprints Sunday

Download and test… everyone

  • Mentors available
  • Test within a week.

This is what we have done…

Who is we?

We are…

  • Vijay Mani
  • Hussain Abbas
  • Chandan Singh
  • Piyuesh Kumar
  • Chakrapani R
  • Top Indian contributors

We are…

DrupalCamp Mumbai

We are…

DrupalCamp Delhi

We are…

Drupal South, Melbourne

We are…

Drupal South, Wellington

We are…

DrupalCon Bogota

We are…

DrupalCamp Costa Rica 2013

We are…

DrupalCon Amsterdam

We are…

DrupalCon Austin

We are…

  • Not Drupalers, but Drupal is PHP

We are…

Code Contributors to Drupal 8

2715 and counting

We are those who work together

  • These are our colleagues
  • Haven't met, but colleagues
  • Core patch
  • Core review
  • Contrib patch or review
  • Docs
  • Helped in IRC, forum, Stack Overflow
  • Helped in person
  • Built a Drupal site

Drupal is a platform for the independent

For everyone

By all of us

Drupal 8 is going to kick-ass

Together

  • Better for us
  • Better for clients
  • Better for PHP
  • Better for the web

Larry Garfield

Palantir.net

Let's make something good together

Keep tabs on our work at @Palantir