rockin' html5 with drupal

81
ROCKIN' HTML5 with DRUPAL JEN SIMMONS

Upload: jen-simmons

Post on 28-Jan-2015

142 views

Category:

Documents


0 download

DESCRIPTION

What's up with HTML5? How can I use it with Drupal? A presentation from DrupalCon Chicago, March 2011.

TRANSCRIPT

Page 1: Rockin' HTML5 With Drupal

ROCKIN' HTML5with

DRUPAL

JEN SIMMONS

Page 2: Rockin' HTML5 With Drupal

JEN SIMMONSCreator of Bartik, the default theme in Drupal 7Designer, front end developer & drupal architect

Drupaling since 2007, building websites since 1996Senior Developer at Palantir

jensimmons.comtwitter: jensimmons

Page 3: Rockin' HTML5 With Drupal

SLIDES AT:

jen.cm/h5

Page 4: Rockin' HTML5 With Drupal

EVOLUTIONOF SUCCESSFUL TECHNOLOGY

Page 5: Rockin' HTML5 With Drupal
Page 6: Rockin' HTML5 With Drupal
Page 7: Rockin' HTML5 With Drupal

A B

Page 8: Rockin' HTML5 With Drupal

WEB 1.0Find somethingReadLook at imagesClick links to find more things

Page 9: Rockin' HTML5 With Drupal
Page 10: Rockin' HTML5 With Drupal

WEB 2.0CommentSign inAdd text, photos, video, audioConnect to other usersBuy thingsParticipate, not just read

Page 11: Rockin' HTML5 With Drupal
Page 12: Rockin' HTML5 With Drupal

1999 2001

today2005

2003

1996

Page 13: Rockin' HTML5 With Drupal

WEB 3.0

?

Page 14: Rockin' HTML5 With Drupal
Page 15: Rockin' HTML5 With Drupal

HTML5SEMANTICMARKUP

Page 16: Rockin' HTML5 With Drupal

<!DOCTYPE html><meta charset="utf-8" /><script src="file.js"></script><link rel="stylesheet" href="file.css" />

Simplified Document Head

Page 17: Rockin' HTML5 With Drupal

$head

$styles

$scripts

Drupal Document Head

Page 18: Rockin' HTML5 With Drupal

<section>

<article>

<aside>

<nav>

+ outlining

New Structural Elements

Page 19: Rockin' HTML5 With Drupal

<header>

<footer>

<fig>

<figcaption>

<mark>

<time>

<meter>

<progress>

New Elements

Page 20: Rockin' HTML5 With Drupal

<header role="banner">

<div role="main">

<nav role="navigation">

ARIA: Landmark Roles

Page 21: Rockin' HTML5 With Drupal
Page 22: Rockin' HTML5 With Drupal
Page 23: Rockin' HTML5 With Drupal
Page 25: Rockin' HTML5 With Drupal

node.tpl.php<article id="node-title" class="node clearfix" > <header> <h1 class="title"><a href="xxx">My First Node</a></h2 </header> <footer> Published on <time datetime=2011-01-22 pubdate>Jan 22</time> </footer> <p>Blah blah blah</p> <p>Blah blah blah</p> <footer> <div class="taxonomy"><ul><li><a>HTML5</a></li></ul></div> </footer></article>

Page 26: Rockin' HTML5 With Drupal

$submitted

menu system

filtered HTML input format

security cleaning

Drupal HTML

Page 27: Rockin' HTML5 With Drupal

HTML5FORMS

Page 28: Rockin' HTML5 With Drupal

<label for="favorite-cms">Your Favorite CMS</label>

<input id="favorite-cms" name="favorite-cms" type="text" placeholder="Drupal. What else?" />

FORMS

/>

Page 29: Rockin' HTML5 With Drupal

HTML5 Forms<input type="text">

<input type="email">

<input type="url">

<input type="date">

<input type="time">

<input type="range">

<input type="color">

<input type="text">

<input type="tel">

<input type="week">

Page 31: Rockin' HTML5 With Drupal

search box

date picker

range with a slider

color picker

HTML5 Forms

Page 33: Rockin' HTML5 With Drupal

HTML5 Form Attributes

autocomplete, min, max, multiple, pattern, step, required, placeholder

<input type="email" required>

<input type="range" min=1 max=11 name=tap>

Page 34: Rockin' HTML5 With Drupal

<label for="email">Email address</label><input id="email" name="email" type="email" />

<label for="website">Website </label><input id="website" name="website" type="url" />

<label for="phone">Phone number</label><input id="phone" name="phone" type="tel" />

<label for="number">How many?</label><input id="number" name="number" type="number" min="0" max="11" step="1" value="5"/>

Page 35: Rockin' HTML5 With Drupal
Page 36: Rockin' HTML5 With Drupal

HTML5 TOOLS

MODULE

drupal.org/project/html5_tools

Page 37: Rockin' HTML5 With Drupal

TOOLSImplement HTML5 Forms

Simplify the output of: $scripts, $styles, $submitted, etc.

Add HTML5 Elements to the Filtered HTML input filter

basically alter core's XHTML before it's markup goes to the theme

Page 38: Rockin' HTML5 With Drupal

MORE HTML5 AWESOMENESS

(and some non-HTML5 awesomeness)

Page 39: Rockin' HTML5 With Drupal

VIDEOAUDIOGAMES

Page 40: Rockin' HTML5 With Drupal

<video><audio>

<canvas>

Page 41: Rockin' HTML5 With Drupal

WEB STORAGE

project.mahemo!.com/sql.html

Page 42: Rockin' HTML5 With Drupal

Web SQLIndex DB

WEB STORAGE

Page 43: Rockin' HTML5 With Drupal

OFFLINE APPLICATIONS

Page 44: Rockin' HTML5 With Drupal

GEOLOCATION

Page 45: Rockin' HTML5 With Drupal

DRAG & DROP

Page 46: Rockin' HTML5 With Drupal

WEB WORKERS

Page 47: Rockin' HTML5 With Drupal

WEB SOCKETS

Page 49: Rockin' HTML5 With Drupal

COMMUNICATION&

MESSAGING

Page 50: Rockin' HTML5 With Drupal

SO CAN WE USE HTML5 TODAY?

Page 51: Rockin' HTML5 With Drupal

NOT IFyou have to support

three particular formerly-popular

browsers

Page 52: Rockin' HTML5 With Drupal

INTERNET EXPLORER 4

NETSCAPE NAVIGATOR 9

FIREFOX 2

Page 53: Rockin' HTML5 With Drupal

YES.

Page 54: Rockin' HTML5 With Drupal

Old BrowserNew Website

New BrowserOld Website

Must work both ways.

Page 55: Rockin' HTML5 With Drupal

YOU CAN'T NOT HAVE YOUR SITE BE

HTML5

(psssst… it already is)

Page 56: Rockin' HTML5 With Drupal

caniuse.com

WHEN CAN I USE?

Page 57: Rockin' HTML5 With Drupal
Page 58: Rockin' HTML5 With Drupal

*The HTML5 Enabling Script aka HTML5 Shiv fixes the lack of support in IE

ejohn.org/blog/html5-shiv

Page 59: Rockin' HTML5 With Drupal
Page 61: Rockin' HTML5 With Drupal
Page 62: Rockin' HTML5 With Drupal

HTML5 DRUPALWORKINGGROUP

groups.drupal.org/html5irc: #drupal-html5

Page 63: Rockin' HTML5 With Drupal

Eric Duran

Alex Ross (bleen)

Jack Aponte(jackalope)

Jen Lampton

Tim PlunkettLin Clark

Alan Burke

Forest Mars

Jared Ponchot (jponch)

Jacine Luisi

Theresa Summa (theresaanna)

Mason Wendell (carnarymason)

Andrei Matteescu (amateescu)

Laura Scott (laura s)

Je! Burnz(jburnz)

Mark Krug (devildogmrk)

John Zavocki (johnvsc)

Matt Farina(mfer)

Pontus Nilsson

Adrian Simmons(adrinux)

(medden)

Stan Angelo!Paul Irish

Nathan Smith

Tom Behets(betz)

António Almeida(perusio)

John Roberts Wilson(jrwilson)

John Albin Wilkins(johnalbin)

Jody Hamilton(Jody Lynn) … AND MORE!

Divya Manian(nimbupani)

Dave Reid

Jen Simmons

Page 64: Rockin' HTML5 With Drupal

TWITTER

@drupalhtml5

STICKERS

LOGO

Page 65: Rockin' HTML5 With Drupal

THE GROUP'S GOALSUse HTML5 today on Drupal 6 & 7 websites.

Figure out best practices for Drupal + HTML5 through real world experiences, sharing knowledge

and building community consensus.

HTML5ify Drupal 8.

Page 66: Rockin' HTML5 With Drupal

HTML5 TOOLS

MODULE

drupal.org/project/html5_tools

Page 67: Rockin' HTML5 With Drupal

TOOLSImplement HTML5 Forms

Simplify the output of: $scripts, $styles, $submitted, etc.

Add HTML5 Elements to the Filtered HTML input filter

basically alter core's XHTML before it's markup goes to the theme

Page 68: Rockin' HTML5 With Drupal

HTML5 BASE

THEME

drupal.org/project/html5_base

Page 69: Rockin' HTML5 With Drupal

HTML5 BASEOverride core templates

(node.tpl, page.tpl, block.tpl, comment.tpl, comment-wrapper.tpl, region.tpl, html.tpl, etc…)

basically HTML5ify Stark

Page 70: Rockin' HTML5 With Drupal
Page 71: Rockin' HTML5 With Drupal

LEARNMORE

Page 72: Rockin' HTML5 With Drupal

Jeremy Keith's Keynote

AT DRUPALCON COPENHAGEN

drupalradar.com/video-jeremy-keith-keynote-session

Page 76: Rockin' HTML5 With Drupal

developers.whatwg.org

THE SPEC ITSELF

Page 78: Rockin' HTML5 With Drupal

groups.drupal.org/html5irc: #drupal-html5

twitter: drupalhtml5

HTML5 DRUPALGROUP

Page 81: Rockin' HTML5 With Drupal

What did you think?

Go to:chicago2011.drupal.org/sessions/rockin-html5-drupal

Click the “Take the Survey” link.Or use the app on your phone.

Thanks!