• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
A New Theme Layer for Drupal 8
 

A New Theme Layer for Drupal 8

on

  • 5,172 views

Drupal 7's theme layer suffered from "Arrays of Doom" and the impenetrable render(). After having to learn and use these tools, the community has rebelled and decided we need to make some major ...

Drupal 7's theme layer suffered from "Arrays of Doom" and the impenetrable render(). After having to learn and use these tools, the community has rebelled and decided we need to make some major changes in Drupal 8.

Come learn about Twig, a new Symfonic templating language we can use to decrease Drupal's learning curve and increase security on every Drupal site.

Statistics

Views

Total Views
5,172
Views on SlideShare
5,132
Embed Views
40

Actions

Likes
3
Downloads
20
Comments
0

4 Embeds 40

http://www.jenlampton.com 13
http://nyccamp.org 12
http://www.nyccamp.org 12
https://twitter.com 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    A New Theme Layer for Drupal 8 A New Theme Layer for Drupal 8 Presentation Transcript

    • A NEW THEME LAYER FOR DRUPAL 8 Jen Lampton ~ @jenlampton Carl Wiedemann ~ @c4rlSaturday, July 21, 2012
    • WHO ARE WE?Saturday, July 21, 2012
    • I AM c4rl (Carl Wiedemann) working with Drupal (since D5) training instructor (since D6) drupal.org redesign team I care a lot about _?_Saturday, July 21, 2012
    • I AM jenlampton (Jen Lampton) working with Drupal (since D4.7) training instructor (since D6) conrib maintainer (youtube, more) since D5 I care a lot about usability & learnabilitySaturday, July 21, 2012
    • WHO ARE YOU?Saturday, July 21, 2012
    • YOU ARE: Theme developers? (D7? D6? D5?)Saturday, July 21, 2012
    • YOU ARE: Theme developers? (D7? D6? D5?) New to Drupal? (just want to know what the heck is going on in D8)Saturday, July 21, 2012
    • YOU ARE: Theme developers? (D7? D6? D5?) New to Drupal? (just want to know what the heck is going on in D8) Drupal Experts? (also want to know what the heck is going on in D8)Saturday, July 21, 2012
    • DRUPAL 8 : A NEW THEME LAYERSaturday, July 21, 2012
    • DRUPAL 8 : A NEW THEME LAYER (probably)Saturday, July 21, 2012
    • WHY?Saturday, July 21, 2012
    • DRUPAL 7 (remember how some of you said that you had built themes for Drupal 7?)Saturday, July 21, 2012
    • DRUPAL 7: POSITIVE  Saturday, July 21, 2012
    • DRUPAL 7: POSITIVE   flexibleSaturday, July 21, 2012
    • DRUPAL 7: POSITIVE   unified data structures everywhereSaturday, July 21, 2012
    • DRUPAL 7: POSITIVE   anyone?Saturday, July 21, 2012
    • DRUPAL 7: NEGATIVE  Saturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   Drupal only (weird) syntaxSaturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   Object or Array?Saturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   print or print render() ?Saturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   complex mix of subsystemsSaturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   PHP is insecureSaturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   Too many template filesSaturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   prone to bugsSaturday, July 21, 2012
    • DRUPAL 7: NEGATIVE   Drupal 7 is too hard to learn!Saturday, July 21, 2012
    • DRUPAL 8 what do we want?Saturday, July 21, 2012
    • DRUPAL 8 what do we want? Something proudly found elsewhereSaturday, July 21, 2012
    • DRUPAL 8 what do we want? ObjectsSaturday, July 21, 2012
    • DRUPAL 8 what do we want? Objects (but not in the templates)Saturday, July 21, 2012
    • DRUPAL 8 what do we want? SecureSaturday, July 21, 2012
    • DRUPAL 8 what do we want? The right templatesSaturday, July 21, 2012
    • DRUPAL 8 what do we want? ConsistencySaturday, July 21, 2012
    • TWIGSaturday, July 21, 2012
    • TWIG A modern template engine for PHP. http://twig.sensiolabs.orgSaturday, July 21, 2012
    • TWIG what’s so great about it? • well documented • extensible • secure • well tested • IDE integration • recognizable syntax • Python (django) • JS (TwigJS) •Ruby (Liquid) •by Symfony’s author, Fabien PotencierSaturday, July 21, 2012
    • TWIG what does it look like?Saturday, July 21, 2012
    • TWIG what does it look like? print with {{ }}Saturday, July 21, 2012
    • TWIG what does it look like? commands with {% %}Saturday, July 21, 2012
    • TWIG what does it look like? comments with {# #}Saturday, July 21, 2012
    • TWIG what does it look like? simple and intuitiveSaturday, July 21, 2012
    • INTERLUDE: attributes attributes are messySaturday, July 21, 2012
    • INTERLUDE: attributes HTML5 attribute types: String Boolean Enumerated attributes are messySaturday, July 21, 2012
    • INTERLUDE: attributes We need attributes to be “drillable” attributes or attributes.class or attributes.idSaturday, July 21, 2012
    • INTERLUDE: attributes PHP5 to the rescue! ArrayAccess allows objects to be treated as arrays __toString allows “flattening” of arrays or objects into HTML strings (almost)Saturday, July 21, 2012
    • INTERLUDE: attributes but, this has nothing to do with TWIG. so let’s do it now: http://drupal.org/node/1290694Saturday, July 21, 2012
    • TWIG how would it work? all theme functions become template files. a single way to override markup!Saturday, July 21, 2012
    • TWIG D7 D8 theme_username becomes username.twigSaturday, July 21, 2012
    • TWIG D7 D8 theme_image becomes image.twigSaturday, July 21, 2012
    • TWIG D7 D8 theme_link becomes link.twigSaturday, July 21, 2012
    • TWIG D7 D8 theme_item_list beomes item_list.twigSaturday, July 21, 2012
    • TWIG how would it work? D7 D8 more like Drupal 6!Saturday, July 21, 2012
    • TWIG how would it work? there’s a lot we still don’t know.Saturday, July 21, 2012
    • TWIG why is this good?Saturday, July 21, 2012
    • TWIG why is this good? remember the complexity of Drupal 7?Saturday, July 21, 2012
    • TWIG why is this good? look what would happen in Drupal 8.Saturday, July 21, 2012
    • TWIG where does this fit in with SCOTCH? The “Blocks everywhere” initiative complicates thingsSaturday, July 21, 2012
    • TWIG where does this fit in with SCOTCH? Blocks in D6 (in red)Saturday, July 21, 2012
    • TWIG where does this fit in with SCOTCH? Blocks in D7 (in red)Saturday, July 21, 2012
    • TWIG where does this fit in with SCOTCH? Blocks in D8 (in red)Saturday, July 21, 2012
    • TWIG while we’re at it... ...let’s clean up the template files!Saturday, July 21, 2012
    • TWIG “Learnability” - Easier to learn than PHP - Consistent - SecureSaturday, July 21, 2012
    • DISCUSS!Saturday, July 21, 2012
    • A NEW THEME LAYER FOR DRUPAL 8 @jenlampton | http://www.jenlampton.com @c4rl | http://www.c4rl.wsSaturday, July 21, 2012
    • photo credits: lolcat-wut: http://www.funnyjunk.com/funny_pictures/1152056/Dude/ lolcat-flexible http://icanhascheezburger.com/2008/10/24/funny-pictures-fexlibility-i-haz-it/ lolcat questionmark http://icanhascheezburger.com/2007/10/31/11197/ questionmark http://fr.wikipedia.org/wiki/Fichier:Question_mark_3d.png wheel-reinvented http://www.brainwads.net/drewhawkins/2012/01/dont-re-invent-the-wheel-make-something-better/ objects http://2teachers1classroom.blogspot.com/2009_02_01_archive.html shapes http://englishclass.jp/reading/topic/For_Screening_Purposes_Only secure http://blog.stratepedia.org/2010/06/03/what-is-a-secure-site/ consistency http://icsigns.org/press/2010/03/23/consistency-staying-on-the-mark/ twig bird comic http://s302.photobucket.com/albums/nn105/walkseva/?action=view&current=thebirdneedsthattwig.gif&currenttag=bird%20park%20twig%20comic%20need%20it scotch http://www.thespir.it/articles/scotch-101/?viewall=1 twig http://galletly.blogspot.com/2009/10/twig.htmlSaturday, July 21, 2012