SlideShare ist ein Scribd-Unternehmen logo
1 von 64
Downloaden Sie, um offline zu lesen
A NEW THEME LAYER
            FOR DRUPAL 8
                          Jen Lampton ~ @jenlampton
                             Carl Wiedemann ~ @c4rl




Saturday, 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 & learnability




Saturday, 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 LAYER



Saturday, 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


                                      




                                 flexible

Saturday, July 21, 2012
DRUPAL 7: POSITIVE


                                            




                           unified data structures everywhere

Saturday, July 21, 2012
DRUPAL 7: POSITIVE


                                     




                                anyone?
Saturday, July 21, 2012
DRUPAL 7: NEGATIVE


                                   




Saturday, July 21, 2012
DRUPAL 7: NEGATIVE


                                          




                             Drupal only (weird) syntax


Saturday, 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 subsystems
Saturday, July 21, 2012
DRUPAL 7: NEGATIVE


                                       




                               PHP is insecure


Saturday, July 21, 2012
DRUPAL 7: NEGATIVE


                                   




                                      Too many template files

Saturday, July 21, 2012
DRUPAL 7: NEGATIVE


                                       




                                prone to bugs


Saturday, 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 elsewhere


Saturday, July 21, 2012
DRUPAL 8
                          what do we want?




                              Objects


Saturday, 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?




                               Secure


Saturday, July 21, 2012
DRUPAL 8
                          what do we want?




                          The right templates


Saturday, July 21, 2012
DRUPAL 8
                          what do we want?




                            Consistency


Saturday, July 21, 2012
TWIG




Saturday, July 21, 2012
TWIG
                          A modern template engine for PHP.




                               http://twig.sensiolabs.org


Saturday, 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 Potencier

Saturday, 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 intuitive


Saturday, July 21, 2012
INTERLUDE:
                               attributes




                          attributes are messy


Saturday, July 21, 2012
INTERLUDE:
                                             attributes

                                       HTML5 attribute types:

                          String

                          Boolean

                          Enumerated


                                        attributes are messy


Saturday, July 21, 2012
INTERLUDE:
                                       attributes

                          We need attributes to be “drillable”

                                       attributes
                                           or
                                    attributes.class
                                           or
                                     attributes.id




Saturday, 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/1290694




Saturday, 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.twig
Saturday, July 21, 2012
TWIG

  D7




  D8


                          theme_image becomes image.twig
Saturday, July 21, 2012
TWIG

  D7



  D8




                          theme_link becomes link.twig
Saturday, July 21, 2012
TWIG
   D7                     D8




                          theme_item_list beomes item_list.twig
Saturday, 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 things

Saturday, 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
                                    - Secure




Saturday, July 21, 2012
DISCUSS!

Saturday, July 21, 2012
A NEW THEME LAYER
                             FOR DRUPAL 8
                          @jenlampton | http://www.jenlampton.com
                                 @c4rl | http://www.c4rl.ws




Saturday, 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.html




Saturday, July 21, 2012

Weitere ähnliche Inhalte

Ähnlich wie A New Theme Layer for Drupal 8

Introducción a Agile y Scrum
Introducción a Agile y ScrumIntroducción a Agile y Scrum
Introducción a Agile y Scrum
betabeers
 

Ähnlich wie A New Theme Layer for Drupal 8 (7)

Introducción a Agile y Scrum
Introducción a Agile y ScrumIntroducción a Agile y Scrum
Introducción a Agile y Scrum
 
Introducción a Agile y Scrum (BetaBeers.com)
Introducción a Agile y Scrum (BetaBeers.com)Introducción a Agile y Scrum (BetaBeers.com)
Introducción a Agile y Scrum (BetaBeers.com)
 
Developer Tools State of the Union
Developer Tools State of the UnionDeveloper Tools State of the Union
Developer Tools State of the Union
 
Larks internationalization presentation
Larks internationalization presentationLarks internationalization presentation
Larks internationalization presentation
 
Drupal 8 UX
Drupal 8 UXDrupal 8 UX
Drupal 8 UX
 
Creating Usable Websites with Interaction Design Patterns: Do It With Drupal!
Creating Usable Websites with Interaction Design Patterns: Do It With Drupal!Creating Usable Websites with Interaction Design Patterns: Do It With Drupal!
Creating Usable Websites with Interaction Design Patterns: Do It With Drupal!
 
Homework9
Homework9Homework9
Homework9
 

Mehr von nyccamp

Drupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better ThemesDrupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better Themes
nyccamp
 
Building Social Networks
Building Social NetworksBuilding Social Networks
Building Social Networks
nyccamp
 
Building Social Networks
Building Social NetworksBuilding Social Networks
Building Social Networks
nyccamp
 
Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)
nyccamp
 

Mehr von nyccamp (19)

Drupal As A Jigsaw
Drupal As A JigsawDrupal As A Jigsaw
Drupal As A Jigsaw
 
A/B Testing and Optimizely Module
A/B Testing and Optimizely ModuleA/B Testing and Optimizely Module
A/B Testing and Optimizely Module
 
Behat - human-readable automated testing
Behat - human-readable automated testingBehat - human-readable automated testing
Behat - human-readable automated testing
 
ALL YOUR BASE (THEMES) ARE BELONG TO US
ALL YOUR BASE (THEMES) ARE BELONG TO USALL YOUR BASE (THEMES) ARE BELONG TO US
ALL YOUR BASE (THEMES) ARE BELONG TO US
 
Drupal Commerce - The Product vs Display Conundrum and How to Explain it to a...
Drupal Commerce - The Product vs Display Conundrum and How to Explain it to a...Drupal Commerce - The Product vs Display Conundrum and How to Explain it to a...
Drupal Commerce - The Product vs Display Conundrum and How to Explain it to a...
 
Promotions Vouchers and Offers in Drupal Commerce
Promotions Vouchers and Offers in Drupal CommercePromotions Vouchers and Offers in Drupal Commerce
Promotions Vouchers and Offers in Drupal Commerce
 
Workbench: Managing Content Management
Workbench: Managing Content ManagementWorkbench: Managing Content Management
Workbench: Managing Content Management
 
Deployment Strategies: Managing Code, Content, and Configurations
Deployment Strategies: Managing Code, Content, and ConfigurationsDeployment Strategies: Managing Code, Content, and Configurations
Deployment Strategies: Managing Code, Content, and Configurations
 
Drupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better ThemesDrupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better Themes
 
Drupal and Higher Education
Drupal and Higher EducationDrupal and Higher Education
Drupal and Higher Education
 
Mobile and Responsive Design with Sass
Mobile and Responsive Design with SassMobile and Responsive Design with Sass
Mobile and Responsive Design with Sass
 
Drupal and Apache Solr Search Go Together Like Pizza and Beer for Your Site
Drupal and Apache Solr Search Go Together Like Pizza and Beer for Your SiteDrupal and Apache Solr Search Go Together Like Pizza and Beer for Your Site
Drupal and Apache Solr Search Go Together Like Pizza and Beer for Your Site
 
Building Social Networks
Building Social NetworksBuilding Social Networks
Building Social Networks
 
The State of Drupal 8
The State of Drupal 8The State of Drupal 8
The State of Drupal 8
 
Building Social Networks
Building Social NetworksBuilding Social Networks
Building Social Networks
 
Move Into Drupal Using The Migrate Module
Move Into Drupal Using The Migrate ModuleMove Into Drupal Using The Migrate Module
Move Into Drupal Using The Migrate Module
 
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
 
Drulenium - Testing Made Easy
Drulenium - Testing Made EasyDrulenium - Testing Made Easy
Drulenium - Testing Made Easy
 
Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)Node Access in Drupal 7 (and Drupal 8)
Node Access in Drupal 7 (and Drupal 8)
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

A New Theme Layer for Drupal 8

  • 1. A NEW THEME LAYER FOR DRUPAL 8 Jen Lampton ~ @jenlampton Carl Wiedemann ~ @c4rl Saturday, July 21, 2012
  • 2. WHO ARE WE? Saturday, July 21, 2012
  • 3. 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
  • 4. 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 & learnability Saturday, July 21, 2012
  • 5. WHO ARE YOU? Saturday, July 21, 2012
  • 6. YOU ARE: Theme developers? (D7? D6? D5?) Saturday, July 21, 2012
  • 7. 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
  • 8. 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
  • 9. DRUPAL 8 : A NEW THEME LAYER Saturday, July 21, 2012
  • 10. DRUPAL 8 : A NEW THEME LAYER (probably) Saturday, July 21, 2012
  • 12. DRUPAL 7 (remember how some of you said that you had built themes for Drupal 7?) Saturday, July 21, 2012
  • 13. DRUPAL 7: POSITIVE   Saturday, July 21, 2012
  • 14. DRUPAL 7: POSITIVE   flexible Saturday, July 21, 2012
  • 15. DRUPAL 7: POSITIVE   unified data structures everywhere Saturday, July 21, 2012
  • 16. DRUPAL 7: POSITIVE   anyone? Saturday, July 21, 2012
  • 17. DRUPAL 7: NEGATIVE   Saturday, July 21, 2012
  • 18. DRUPAL 7: NEGATIVE   Drupal only (weird) syntax Saturday, July 21, 2012
  • 19. DRUPAL 7: NEGATIVE   Object or Array? Saturday, July 21, 2012
  • 20. DRUPAL 7: NEGATIVE   print or print render() ? Saturday, July 21, 2012
  • 21. DRUPAL 7: NEGATIVE   complex mix of subsystems Saturday, July 21, 2012
  • 22. DRUPAL 7: NEGATIVE   PHP is insecure Saturday, July 21, 2012
  • 23. DRUPAL 7: NEGATIVE   Too many template files Saturday, July 21, 2012
  • 24. DRUPAL 7: NEGATIVE   prone to bugs Saturday, July 21, 2012
  • 25. DRUPAL 7: NEGATIVE   Drupal 7 is too hard to learn! Saturday, July 21, 2012
  • 26. DRUPAL 8 what do we want? Saturday, July 21, 2012
  • 27. DRUPAL 8 what do we want? Something proudly found elsewhere Saturday, July 21, 2012
  • 28. DRUPAL 8 what do we want? Objects Saturday, July 21, 2012
  • 29. DRUPAL 8 what do we want? Objects (but not in the templates) Saturday, July 21, 2012
  • 30. DRUPAL 8 what do we want? Secure Saturday, July 21, 2012
  • 31. DRUPAL 8 what do we want? The right templates Saturday, July 21, 2012
  • 32. DRUPAL 8 what do we want? Consistency Saturday, July 21, 2012
  • 34. TWIG A modern template engine for PHP. http://twig.sensiolabs.org Saturday, July 21, 2012
  • 35. 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 Potencier Saturday, July 21, 2012
  • 36. TWIG what does it look like? Saturday, July 21, 2012
  • 37. TWIG what does it look like? print with {{ }} Saturday, July 21, 2012
  • 38. TWIG what does it look like? commands with {% %} Saturday, July 21, 2012
  • 39. TWIG what does it look like? comments with {# #} Saturday, July 21, 2012
  • 40. TWIG what does it look like? simple and intuitive Saturday, July 21, 2012
  • 41. INTERLUDE: attributes attributes are messy Saturday, July 21, 2012
  • 42. INTERLUDE: attributes HTML5 attribute types: String Boolean Enumerated attributes are messy Saturday, July 21, 2012
  • 43. INTERLUDE: attributes We need attributes to be “drillable” attributes or attributes.class or attributes.id Saturday, July 21, 2012
  • 44. 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
  • 45. INTERLUDE: attributes but, this has nothing to do with TWIG. so let’s do it now: http://drupal.org/node/1290694 Saturday, July 21, 2012
  • 46. TWIG how would it work? all theme functions become template files. a single way to override markup! Saturday, July 21, 2012
  • 47. TWIG D7 D8 theme_username becomes username.twig Saturday, July 21, 2012
  • 48. TWIG D7 D8 theme_image becomes image.twig Saturday, July 21, 2012
  • 49. TWIG D7 D8 theme_link becomes link.twig Saturday, July 21, 2012
  • 50. TWIG D7 D8 theme_item_list beomes item_list.twig Saturday, July 21, 2012
  • 51. TWIG how would it work? D7 D8 more like Drupal 6! Saturday, July 21, 2012
  • 52. TWIG how would it work? there’s a lot we still don’t know. Saturday, July 21, 2012
  • 53. TWIG why is this good? Saturday, July 21, 2012
  • 54. TWIG why is this good? remember the complexity of Drupal 7? Saturday, July 21, 2012
  • 55. TWIG why is this good? look what would happen in Drupal 8. Saturday, July 21, 2012
  • 56. TWIG where does this fit in with SCOTCH? The “Blocks everywhere” initiative complicates things Saturday, July 21, 2012
  • 57. TWIG where does this fit in with SCOTCH? Blocks in D6 (in red) Saturday, July 21, 2012
  • 58. TWIG where does this fit in with SCOTCH? Blocks in D7 (in red) Saturday, July 21, 2012
  • 59. TWIG where does this fit in with SCOTCH? Blocks in D8 (in red) Saturday, July 21, 2012
  • 60. TWIG while we’re at it... ...let’s clean up the template files! Saturday, July 21, 2012
  • 61. TWIG “Learnability” - Easier to learn than PHP - Consistent - Secure Saturday, July 21, 2012
  • 63. A NEW THEME LAYER FOR DRUPAL 8 @jenlampton | http://www.jenlampton.com @c4rl | http://www.c4rl.ws Saturday, July 21, 2012
  • 64. 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.html Saturday, July 21, 2012