SlideShare une entreprise Scribd logo
1  sur  114
Télécharger pour lire hors ligne
THE NEW THEME LAYER
          IN DRUPAL 8
                           Jen Lampton




Thursday, April 11, 2013
JEN LAMPTON

                                   @jenlampton on twitter
                           “jenlampton” http://drupal.org/user/85586
                                    www.jenlampton.com
                                                




                 if you forget my name, just Google “Drupal developer”




Thursday, April 11, 2013
MY BACKGROUND


                                          




                            Building websites since 1997
Thursday, April 11, 2013
MY BACKGROUND


                                           




                            Working with Drupal since 2006
Thursday, April 11, 2013
MY BACKGROUND


                                          




                            Consider myself a developer.
Thursday, April 11, 2013
MY BACKGROUND


                                         




                              Also a Drupal trainer.
Thursday, April 11, 2013
MY BACKGROUND


                                               




                           Accidental Drupal 8 “initiative” leader.
Thursday, April 11, 2013
MY “INITIATIVE”
                                (unofficial)




                                      




Thursday, April 11, 2013
MY “INITIATIVE”
                                (unofficial)




                                      




       A new theme layer for Drupal 8

Thursday, April 11, 2013
THEME LAYER?
                1) Generation of Markup:

                •Template files (as close to HTML as possible)
                •Preparation of data (for insertion into template files)
                •Addition of assets (CSS + JS)
                                            




Thursday, April 11, 2013
THEME LAYER?
                2) System of complete overrides:

                •Alteration of HTML in template files
                •Alteration of data (before insertion into templates)
                •Inclusion of additional assets      



                           (or exclusion of existing assets)




Thursday, April 11, 2013
THEME LAYER?
                3) System of partial overrides:

                •Alteration of HTML in template files
                •Alteration of data (before insertion into templates)
                •Inclusion of additional assets      



                           (or exclusion of existing assets)

                ...but only under certain circumstances.




Thursday, April 11, 2013
DRUPAL 7 THEME LAYER
                           but, we have this now!




                                      




Thursday, April 11, 2013
DRUPAL 7 THEME LAYER
                           it looks like this (simplified)




                                          




Thursday, April 11, 2013
DRUPAL 7 THEME LAYER
                             it feels like this




                                      




Thursday, April 11, 2013
HARD TO LEARN


                                  




Thursday, April 11, 2013
HARD TO LEARN
                              for lots of reasons




                                        




Thursday, April 11, 2013
HARD TO LEARN
                                Mixed data types




                                          




                             String, Object or Array?

Thursday, April 11, 2013
HARD TO LEARN
                           Different methods of printing variables




                                               




                                  print or print render()?

Thursday, April 11, 2013
HARD TO LEARN
                                  Two ways to override markup:
                           TEMPLATE FILES           THEME FUNCTIONS


                                                




                                      When do I use what?

Thursday, April 11, 2013
HARD


                            
                               Too many template files




Thursday, April 11, 2013
HARDER


                           Way too many theme functions
                               




Thursday, April 11, 2013
HARD TO LEARN
                               Insecure.




                                    




Thursday, April 11, 2013
HARD TO LEARN
                              Really, it’s insecure.




                                         




Thursday, April 11, 2013
HARD TO LEARN
                                  Drupal-specific




                                         




               Drupalism noun Something that only exists in Drupal.

Thursday, April 11, 2013
HARD TO LEARN


                                         




                           too many complex subsystems

Thursday, April 11, 2013
HARD TO LEARN
                                      because

              1. Mixed data types (strings, objects & arrays)
              2. Different methods of printing variables (print, render)
              3.Two ways to override markup: templates & theme fns
                                            



              4. Too many template files & Too many theme functions
              5. Insecure
              6. Drupal-specific
              7. A complex mix of subsystems




Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                           Principals to guide us.




                             lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
      Core default markup should strive for semantic simplicity, with
      few HTML elements, added only as needed




                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
      We won't assume we know what people want or add features
      based on "What-if...?" We will think about the 90% of use cases.




                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
    3. Provide tools
      Give front-end experts a way to achieve specific goals; goals that
      apply to the remaining 10% of use cases.




                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
    3. Provide tools
    4. Consolidate
      Don't make something new when something common can be
      used instead. (let’s create a Theme Component Library).




                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
    3. Provide tools
    4. Consolidate
    5. Visibility
      You should be able to see what's going on without reading docs.




                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
    3. Provide tools
    4. Consolidate
    5. Visibility
    6. Consistency
      Do the same things everywhere, follow patterns.




                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
    3. Provide tools
    4. Consolidate
    5. Visibility
    6. Consistency
    7. Don't dumb it down
      Complexity should be reduced but not obscured.



                            lb.com/twig#principles

Thursday, April 11, 2013
DRUPAL 8 THEME LAYER
                            Principals to guide us
    1. Start with nothing
    2. Build from use cases
    3. Provide tools
    4. Consolidate
    5. Visibility
    6. Consistency
    7. Don't dumb it down
    8. Organization should be driven by meaning and
    semantics over technical convenience
      Consider what an element means rather than how it
      structurally appears. Theme developers want to see markup in
      templates, not abstraction.

Thursday, April 11, 2013
A NEW THEME ENGINE?




Thursday, April 11, 2013
TWIG




                           well documented

Thursday, April 11, 2013
TWIG




                           extensible

Thursday, April 11, 2013
TWIG




                           secure

Thursday, April 11, 2013
TWIG




                            fast

Thursday, April 11, 2013
TWIG




                           IDE integration

Thursday, April 11, 2013
TWIG




                           recognizable syntax

Thursday, April 11, 2013
TWIG




                           by the creator of Symfony, Fabien Potencier

Thursday, April 11, 2013
TWIG
                           what does it look like?




Thursday, April 11, 2013
TWIG
                           what does it look like?




Thursday, April 11, 2013
TWIG
                           print with {{ }}




Thursday, April 11, 2013
TWIG
                           commands with {% %}




Thursday, April 11, 2013
TWIG
                           comments with {# #}




Thursday, April 11, 2013
TWIG
                           drill down into all variables with .




Thursday, April 11, 2013
TWIG

                           All markup is generated in template files.




Thursday, April 11, 2013
D7 PAIN POINTS
                               does Twig help?

              1. Mixed data types
              2. Different methods of printing variables
              3.Two ways to override markup
                                         



              4. Too many template files & theme functions
              5. Insecure
              6. Drupal-specific
              7. A complex mix of subsystems




Thursday, April 11, 2013
D7 PAIN POINTS
                                    does Twig help?

              1. Mixed data types

                                            




Thursday, April 11, 2013
D7 PAIN POINTS
                              does Twig help?

              1. Mixed data types
                    All template variables are accessed
                                  consistently:
                                      



                                     node.nid
                                   content.links




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED

                                        




Thursday, April 11, 2013
D7 PAIN POINTS
                                   does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables
                                            




Thursday, April 11, 2013
D7 PAIN POINTS
                              does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables
               Removed calls to render() from templates:
                                      



                                   {{ node.nid }}
                                 {{ content.links }}




Thursday, April 11, 2013
D7 PAIN POINTS
                                 does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
                                          




Thursday, April 11, 2013
D7 PAIN POINTS
                                 does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup
                                          




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup
                                        



                 All theme functions become templates.
                         node.tpl.php becomes node.html.twig
                        theme_table() becomes table.html.twig




Thursday, April 11, 2013
D7 PAIN POINTS
                                 does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                          




Thursday, April 11, 2013
D7 PAIN POINTS
                                 does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                          



              4. Too many template files & theme functions




Thursday, April 11, 2013
D7 PAIN POINTS
                                 does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                          



              4. Too many template files & theme functions
                      We’re working on this right now




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure
               All variables are *automatically* sanitized
                           and most PHP functions
                   cannot be executed in template files.



Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure FIXED




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure FIXED
              6. Drupal-specific




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure FIXED
              6. Drupal-specific
                     Twig is used elsewhere on the web
                is syntactically similar to other languages
                       and looks a lot more like HTML.


Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure FIXED
              6. Drupal-specific FIXED




Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure FIXED
              6. Drupal-specific FIXED
              7. A complex mix of subsystems




Thursday, April 11, 2013
D7 THEME LAYER




Thursday, April 11, 2013
D8 IMPROVEMENTS




                           remove theme functions (and overrides) entirely.

Thursday, April 11, 2013
D8 IMPROVEMENTS




                               remove process.

Thursday, April 11, 2013
D8 IMPROVEMENTS




                               remove render.

Thursday, April 11, 2013
D8 IMPROVEMENTS




                               remove page alter?

Thursday, April 11, 2013
D9 IMPROVEMENTS




                              remove preprocess?

Thursday, April 11, 2013
D7 PAIN POINTS
                               does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                       



              4. Too many template files & theme functions @todo
              5. Insecure FIXED
              6. Drupal-specific FIXED
              7. A complex mix of subsystems
              We can remove all theme functions, render,
                     process & (maybe) preprocess too.


Thursday, April 11, 2013
D7 PAIN POINTS
                                does Twig help?


              1. Mixed data types FIXED
              2. Different methods of printing variables FIXED
              3.Two ways to override markup FIXED
                                        



              4. Too many template files & theme functions @todo
              5. Insecure FIXED
              6. Drupal-specific FIXED
              7. A complex mix of subsystems @todo




Thursday, April 11, 2013
D7 PAIN POINTS
                             does Twig help?




                                     




Thursday, April 11, 2013
D7 PAIN POINTS
                             does Twig help?
                                  YES!!!


                                     




Thursday, April 11, 2013
TWIG: OTHER WINS




Thursday, April 11, 2013
TWIG: OTHER WINS
                            less code than PHP functions




Thursday, April 11, 2013
TWIG: OTHER WINS
                               less code than PHP functions
                                                                 D7




                                                                 D8


                           theme_image becomes image.html.twig
Thursday, April 11, 2013
TWIG
                                  less code than PHP functions

                                                   D7




         D8




                           theme_username becomes username.html.twig
Thursday, April 11, 2013
TWIG
                            less code than PHP functions




                                                               D7

    D8




                           theme_link becomes link.html.twig
Thursday, April 11, 2013
D7

                                lots less code than PHP functions


                                                               D8




                                     theme_item_list becomes
                                        item_list.html.twig
Thursday, April 11, 2013
TWIG: OTHER WINS
                             Awesome template inspection.




Thursday, April 11, 2013
TWIG: OTHER WINS
                             Awesome template inspection.




                               (“devel themer” in core)

Thursday, April 11, 2013
TWIG: OTHER WINS
                             Awesome variable inspection.




Thursday, April 11, 2013
TWIG: OTHER WINS
                             Awesome variable inspection.




                                (devel’s dpm() in core)

Thursday, April 11, 2013
TWIG: OTHER WINS
                               Template inheritance




Thursday, April 11, 2013
TWIG: OTHER WINS
                                  Template inheritance




                            comment-wrapper.html.twig before

Thursday, April 11, 2013
TWIG: OTHER WINS
                                 Template inheritance




                            comment-wrapper.html.twig after

Thursday, April 11, 2013
TWIG: OTHER WINS
                                  Template inheritance




                            comment-wrapper--forum.html.twig
                                    (child template)
Thursday, April 11, 2013
TWIG: OTHER WINS
                           Possible performance gains (Much TBD)




Thursday, April 11, 2013
TWIG: OTHER WINS
                           Possible performance gains (Much TBD)

               • PHPtemplate reads files from disk on every use
                 (or stat()s them with APC)
               • Twig templates are read once & compiled into classes




Thursday, April 11, 2013
TWIG: OTHER WINS
                           Possible performance gains (Much TBD)

               • PHPtemplate reads files from disk on every use
                 (or stat()s them with APC)
               • Twig templates are read once & compiled into classes
               Rendering should get much faster when the same
               content element appears multiple times on the page.




Thursday, April 11, 2013
TWIG: OTHER WINS
                           Possible performance gains (Much TBD)

               • PHPtemplate reads files from disk on every use
                 (or stat()s them with APC)
               • Twig templates are read once & compiled into classes
               Rendering should get much faster when the same
               content element appears multiple times on the page.

               Consolidating many similar templates will result in an
               additional gain.


Thursday, April 11, 2013
TWIG: OTHER WINS
                           In-browser template editing finally safe.




Thursday, April 11, 2013
TWIG: OTHER WINS
                           In-browser template editing finally safe.


                • Saving PHP code in the database is a HUGE no-no.
                • Twig is not PHP, and is safe to store!




Thursday, April 11, 2013
TWIG: OTHER WINS
                           In-browser template editing finally safe.


                • Saving PHP code in the database is a HUGE no-no.
                • Twig is not PHP, and is safe to store!
                Modules like ‘Contemplate’ (Content templates) will
                finally be safe to use.




Thursday, April 11, 2013
TWIG: OTHER WINS
                           In-browser template editing finally safe.


                • Saving PHP code in the database is a HUGE no-no.
                • Twig is not PHP, and is safe to store!
                Modules like ‘Contemplate’ (Content templates) will
                finally be safe to use.

                In-browser template editing is something WordPress
                users have been asking of Drupal for a very long time.



Thursday, April 11, 2013
TWIG: OTHER WINS
                   Twig template files can be used on the front end, too.




Thursday, April 11, 2013
TWIG: OTHER WINS
                   Twig template files can be used on the front end, too.

     One template can return markup for both your PHP-generated
       pages, as well as pages generated vi JS in AJAX callbacks.




Thursday, April 11, 2013
TWIG: OTHER WINS
                   Twig template files can be used on the front end, too.

     One template can return markup for both your PHP-generated
       pages, as well as pages generated vi JS in AJAX callbacks.

                      We can use other open source libraries like TwigJS.
                           (https://github.com/schmittjoh/twig.js)




Thursday, April 11, 2013
TWIG: OTHER WINS
                           2-way communication between UI and code.




Thursday, April 11, 2013
TWIG: OTHER WINS
                           2-way communication between UI and code.


                                        No broken UIs.




Thursday, April 11, 2013
TWIG: OTHER WINS
                           2-way communication between UI and code.


                                        No broken UIs.

     Template files can be created first, and the Drupal site can build
      itself* based on the presence and location of variables in the
                                templates.




                                         *within reason

Thursday, April 11, 2013
THE NEW THEME LAYER
          IN DRUPAL 8
                           looks pretty awesome, right?




Thursday, April 11, 2013
QUESTIONS?

Thursday, April 11, 2013
HELP US GET THERE
                                  we need your help!

                            we could be “done” in 1.5 weeks

                             http://drupal.org/node/1757550

                                   IRC: #drupal-twig




Thursday, April 11, 2013
THE NEW THEME LAYER
          IN DRUPAL 8
                           Jen Lampton ~ @jenlampton
                               www.jenlampton.com




Thursday, April 11, 2013
photo credits:
                                                                                  lolcat-flexible
                                                                      http://cheezburger.com/2679924736

                                                                           anything is possible pebbles
                                                                   http://www.invergordontours.com/aip.html

                                                                                lolcat questionmark
                                                                http://icanhascheezburger.com/2007/10/31/11197/

                                                                               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

                                                                               twig docs screenshots
                                                                     http://twig.sensiolabs.org/documentation

                                                                                twig speed graphs
                                                                            http://phpcomparison.net/

                                                                                    python icon
                                                                            http://python-hosting.org/

                                                                                     ruby icon
                                                                         http://itmediaconnect.ro/en/web

                                                                                    django logo
                                                           http://py-arahat.blogspot.com/2010/08/django-vs-pylons.html

                                                                                   symfony logo
                                                                             http://symfony.com/logo

                                                                                   scotch glass
                                                               http://www.thespir.it/articles/scotch-101/?viewall=1

                                                                                 speech bubble
                                               http://ljtfash.blogspot.com/2012/10/youre-beautiful-no-matter-what-they-say.html


Thursday, April 11, 2013

Contenu connexe

En vedette

Modular applications with montage components
Modular applications with montage componentsModular applications with montage components
Modular applications with montage componentsBenoit Marchant
 
The Wonderful World of Drupal 8 Multilingual
The Wonderful World of Drupal 8 MultilingualThe Wonderful World of Drupal 8 Multilingual
The Wonderful World of Drupal 8 MultilingualSuzanne Dergacheva
 
Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Jay Friendly
 
Drupal 8 override: services and plugins
Drupal 8 override: services and pluginsDrupal 8 override: services and plugins
Drupal 8 override: services and pluginsAnton Ivanov
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionJeff Geerling
 
Agriculture connectée 4.0
Agriculture connectée 4.0Agriculture connectée 4.0
Agriculture connectée 4.0Jérôme Monteil
 

En vedette (7)

Modular applications with montage components
Modular applications with montage componentsModular applications with montage components
Modular applications with montage components
 
The Wonderful World of Drupal 8 Multilingual
The Wonderful World of Drupal 8 MultilingualThe Wonderful World of Drupal 8 Multilingual
The Wonderful World of Drupal 8 Multilingual
 
Paragraphs at drupal 8.
Paragraphs at drupal 8.Paragraphs at drupal 8.
Paragraphs at drupal 8.
 
Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Automated php unit testing in drupal 8
Automated php unit testing in drupal 8
 
Drupal 8 override: services and plugins
Drupal 8 override: services and pluginsDrupal 8 override: services and plugins
Drupal 8 override: services and plugins
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
 
Agriculture connectée 4.0
Agriculture connectée 4.0Agriculture connectée 4.0
Agriculture connectée 4.0
 

Dernier

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Dernier (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Twig & the new theme layer in Drupal 8

  • 1. THE NEW THEME LAYER IN DRUPAL 8 Jen Lampton Thursday, April 11, 2013
  • 2. JEN LAMPTON @jenlampton on twitter “jenlampton” http://drupal.org/user/85586 www.jenlampton.com   if you forget my name, just Google “Drupal developer” Thursday, April 11, 2013
  • 3. MY BACKGROUND   Building websites since 1997 Thursday, April 11, 2013
  • 4. MY BACKGROUND   Working with Drupal since 2006 Thursday, April 11, 2013
  • 5. MY BACKGROUND   Consider myself a developer. Thursday, April 11, 2013
  • 6. MY BACKGROUND   Also a Drupal trainer. Thursday, April 11, 2013
  • 7. MY BACKGROUND   Accidental Drupal 8 “initiative” leader. Thursday, April 11, 2013
  • 8. MY “INITIATIVE” (unofficial)   Thursday, April 11, 2013
  • 9. MY “INITIATIVE” (unofficial)   A new theme layer for Drupal 8 Thursday, April 11, 2013
  • 10. THEME LAYER? 1) Generation of Markup: •Template files (as close to HTML as possible) •Preparation of data (for insertion into template files) •Addition of assets (CSS + JS)   Thursday, April 11, 2013
  • 11. THEME LAYER? 2) System of complete overrides: •Alteration of HTML in template files •Alteration of data (before insertion into templates) •Inclusion of additional assets   (or exclusion of existing assets) Thursday, April 11, 2013
  • 12. THEME LAYER? 3) System of partial overrides: •Alteration of HTML in template files •Alteration of data (before insertion into templates) •Inclusion of additional assets   (or exclusion of existing assets) ...but only under certain circumstances. Thursday, April 11, 2013
  • 13. DRUPAL 7 THEME LAYER but, we have this now!   Thursday, April 11, 2013
  • 14. DRUPAL 7 THEME LAYER it looks like this (simplified)   Thursday, April 11, 2013
  • 15. DRUPAL 7 THEME LAYER it feels like this   Thursday, April 11, 2013
  • 16. HARD TO LEARN   Thursday, April 11, 2013
  • 17. HARD TO LEARN for lots of reasons   Thursday, April 11, 2013
  • 18. HARD TO LEARN Mixed data types   String, Object or Array? Thursday, April 11, 2013
  • 19. HARD TO LEARN Different methods of printing variables   print or print render()? Thursday, April 11, 2013
  • 20. HARD TO LEARN Two ways to override markup: TEMPLATE FILES THEME FUNCTIONS   When do I use what? Thursday, April 11, 2013
  • 21. HARD   Too many template files Thursday, April 11, 2013
  • 22. HARDER Way too many theme functions   Thursday, April 11, 2013
  • 23. HARD TO LEARN Insecure.   Thursday, April 11, 2013
  • 24. HARD TO LEARN Really, it’s insecure.   Thursday, April 11, 2013
  • 25. HARD TO LEARN Drupal-specific   Drupalism noun Something that only exists in Drupal. Thursday, April 11, 2013
  • 26. HARD TO LEARN   too many complex subsystems Thursday, April 11, 2013
  • 27. HARD TO LEARN because 1. Mixed data types (strings, objects & arrays) 2. Different methods of printing variables (print, render) 3.Two ways to override markup: templates & theme fns   4. Too many template files & Too many theme functions 5. Insecure 6. Drupal-specific 7. A complex mix of subsystems Thursday, April 11, 2013
  • 28. DRUPAL 8 THEME LAYER Principals to guide us. lb.com/twig#principles Thursday, April 11, 2013
  • 29. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing Core default markup should strive for semantic simplicity, with few HTML elements, added only as needed lb.com/twig#principles Thursday, April 11, 2013
  • 30. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases We won't assume we know what people want or add features based on "What-if...?" We will think about the 90% of use cases. lb.com/twig#principles Thursday, April 11, 2013
  • 31. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases 3. Provide tools Give front-end experts a way to achieve specific goals; goals that apply to the remaining 10% of use cases. lb.com/twig#principles Thursday, April 11, 2013
  • 32. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases 3. Provide tools 4. Consolidate Don't make something new when something common can be used instead. (let’s create a Theme Component Library). lb.com/twig#principles Thursday, April 11, 2013
  • 33. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases 3. Provide tools 4. Consolidate 5. Visibility You should be able to see what's going on without reading docs. lb.com/twig#principles Thursday, April 11, 2013
  • 34. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases 3. Provide tools 4. Consolidate 5. Visibility 6. Consistency Do the same things everywhere, follow patterns. lb.com/twig#principles Thursday, April 11, 2013
  • 35. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases 3. Provide tools 4. Consolidate 5. Visibility 6. Consistency 7. Don't dumb it down Complexity should be reduced but not obscured. lb.com/twig#principles Thursday, April 11, 2013
  • 36. DRUPAL 8 THEME LAYER Principals to guide us 1. Start with nothing 2. Build from use cases 3. Provide tools 4. Consolidate 5. Visibility 6. Consistency 7. Don't dumb it down 8. Organization should be driven by meaning and semantics over technical convenience Consider what an element means rather than how it structurally appears. Theme developers want to see markup in templates, not abstraction. Thursday, April 11, 2013
  • 37. A NEW THEME ENGINE? Thursday, April 11, 2013
  • 38. TWIG well documented Thursday, April 11, 2013
  • 39. TWIG extensible Thursday, April 11, 2013
  • 40. TWIG secure Thursday, April 11, 2013
  • 41. TWIG fast Thursday, April 11, 2013
  • 42. TWIG IDE integration Thursday, April 11, 2013
  • 43. TWIG recognizable syntax Thursday, April 11, 2013
  • 44. TWIG by the creator of Symfony, Fabien Potencier Thursday, April 11, 2013
  • 45. TWIG what does it look like? Thursday, April 11, 2013
  • 46. TWIG what does it look like? Thursday, April 11, 2013
  • 47. TWIG print with {{ }} Thursday, April 11, 2013
  • 48. TWIG commands with {% %} Thursday, April 11, 2013
  • 49. TWIG comments with {# #} Thursday, April 11, 2013
  • 50. TWIG drill down into all variables with . Thursday, April 11, 2013
  • 51. TWIG All markup is generated in template files. Thursday, April 11, 2013
  • 52. D7 PAIN POINTS does Twig help? 1. Mixed data types 2. Different methods of printing variables 3.Two ways to override markup   4. Too many template files & theme functions 5. Insecure 6. Drupal-specific 7. A complex mix of subsystems Thursday, April 11, 2013
  • 53. D7 PAIN POINTS does Twig help? 1. Mixed data types   Thursday, April 11, 2013
  • 54. D7 PAIN POINTS does Twig help? 1. Mixed data types All template variables are accessed consistently:   node.nid content.links Thursday, April 11, 2013
  • 55. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED   Thursday, April 11, 2013
  • 56. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables   Thursday, April 11, 2013
  • 57. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables Removed calls to render() from templates:   {{ node.nid }} {{ content.links }} Thursday, April 11, 2013
  • 58. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED   Thursday, April 11, 2013
  • 59. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup   Thursday, April 11, 2013
  • 60. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup   All theme functions become templates. node.tpl.php becomes node.html.twig theme_table() becomes table.html.twig Thursday, April 11, 2013
  • 61. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   Thursday, April 11, 2013
  • 62. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions Thursday, April 11, 2013
  • 63. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions We’re working on this right now Thursday, April 11, 2013
  • 64. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo Thursday, April 11, 2013
  • 65. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure Thursday, April 11, 2013
  • 66. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure All variables are *automatically* sanitized and most PHP functions cannot be executed in template files. Thursday, April 11, 2013
  • 67. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED Thursday, April 11, 2013
  • 68. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED 6. Drupal-specific Thursday, April 11, 2013
  • 69. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED 6. Drupal-specific Twig is used elsewhere on the web is syntactically similar to other languages and looks a lot more like HTML. Thursday, April 11, 2013
  • 70. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED 6. Drupal-specific FIXED Thursday, April 11, 2013
  • 71. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED 6. Drupal-specific FIXED 7. A complex mix of subsystems Thursday, April 11, 2013
  • 72. D7 THEME LAYER Thursday, April 11, 2013
  • 73. D8 IMPROVEMENTS remove theme functions (and overrides) entirely. Thursday, April 11, 2013
  • 74. D8 IMPROVEMENTS remove process. Thursday, April 11, 2013
  • 75. D8 IMPROVEMENTS remove render. Thursday, April 11, 2013
  • 76. D8 IMPROVEMENTS remove page alter? Thursday, April 11, 2013
  • 77. D9 IMPROVEMENTS remove preprocess? Thursday, April 11, 2013
  • 78. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED 6. Drupal-specific FIXED 7. A complex mix of subsystems We can remove all theme functions, render, process & (maybe) preprocess too. Thursday, April 11, 2013
  • 79. D7 PAIN POINTS does Twig help? 1. Mixed data types FIXED 2. Different methods of printing variables FIXED 3.Two ways to override markup FIXED   4. Too many template files & theme functions @todo 5. Insecure FIXED 6. Drupal-specific FIXED 7. A complex mix of subsystems @todo Thursday, April 11, 2013
  • 80. D7 PAIN POINTS does Twig help?   Thursday, April 11, 2013
  • 81. D7 PAIN POINTS does Twig help? YES!!!   Thursday, April 11, 2013
  • 82. TWIG: OTHER WINS Thursday, April 11, 2013
  • 83. TWIG: OTHER WINS less code than PHP functions Thursday, April 11, 2013
  • 84. TWIG: OTHER WINS less code than PHP functions D7 D8 theme_image becomes image.html.twig Thursday, April 11, 2013
  • 85. TWIG less code than PHP functions D7 D8 theme_username becomes username.html.twig Thursday, April 11, 2013
  • 86. TWIG less code than PHP functions D7 D8 theme_link becomes link.html.twig Thursday, April 11, 2013
  • 87. D7 lots less code than PHP functions D8 theme_item_list becomes item_list.html.twig Thursday, April 11, 2013
  • 88. TWIG: OTHER WINS Awesome template inspection. Thursday, April 11, 2013
  • 89. TWIG: OTHER WINS Awesome template inspection. (“devel themer” in core) Thursday, April 11, 2013
  • 90. TWIG: OTHER WINS Awesome variable inspection. Thursday, April 11, 2013
  • 91. TWIG: OTHER WINS Awesome variable inspection. (devel’s dpm() in core) Thursday, April 11, 2013
  • 92. TWIG: OTHER WINS Template inheritance Thursday, April 11, 2013
  • 93. TWIG: OTHER WINS Template inheritance comment-wrapper.html.twig before Thursday, April 11, 2013
  • 94. TWIG: OTHER WINS Template inheritance comment-wrapper.html.twig after Thursday, April 11, 2013
  • 95. TWIG: OTHER WINS Template inheritance comment-wrapper--forum.html.twig (child template) Thursday, April 11, 2013
  • 96. TWIG: OTHER WINS Possible performance gains (Much TBD) Thursday, April 11, 2013
  • 97. TWIG: OTHER WINS Possible performance gains (Much TBD) • PHPtemplate reads files from disk on every use (or stat()s them with APC) • Twig templates are read once & compiled into classes Thursday, April 11, 2013
  • 98. TWIG: OTHER WINS Possible performance gains (Much TBD) • PHPtemplate reads files from disk on every use (or stat()s them with APC) • Twig templates are read once & compiled into classes Rendering should get much faster when the same content element appears multiple times on the page. Thursday, April 11, 2013
  • 99. TWIG: OTHER WINS Possible performance gains (Much TBD) • PHPtemplate reads files from disk on every use (or stat()s them with APC) • Twig templates are read once & compiled into classes Rendering should get much faster when the same content element appears multiple times on the page. Consolidating many similar templates will result in an additional gain. Thursday, April 11, 2013
  • 100. TWIG: OTHER WINS In-browser template editing finally safe. Thursday, April 11, 2013
  • 101. TWIG: OTHER WINS In-browser template editing finally safe. • Saving PHP code in the database is a HUGE no-no. • Twig is not PHP, and is safe to store! Thursday, April 11, 2013
  • 102. TWIG: OTHER WINS In-browser template editing finally safe. • Saving PHP code in the database is a HUGE no-no. • Twig is not PHP, and is safe to store! Modules like ‘Contemplate’ (Content templates) will finally be safe to use. Thursday, April 11, 2013
  • 103. TWIG: OTHER WINS In-browser template editing finally safe. • Saving PHP code in the database is a HUGE no-no. • Twig is not PHP, and is safe to store! Modules like ‘Contemplate’ (Content templates) will finally be safe to use. In-browser template editing is something WordPress users have been asking of Drupal for a very long time. Thursday, April 11, 2013
  • 104. TWIG: OTHER WINS Twig template files can be used on the front end, too. Thursday, April 11, 2013
  • 105. TWIG: OTHER WINS Twig template files can be used on the front end, too. One template can return markup for both your PHP-generated pages, as well as pages generated vi JS in AJAX callbacks. Thursday, April 11, 2013
  • 106. TWIG: OTHER WINS Twig template files can be used on the front end, too. One template can return markup for both your PHP-generated pages, as well as pages generated vi JS in AJAX callbacks. We can use other open source libraries like TwigJS. (https://github.com/schmittjoh/twig.js) Thursday, April 11, 2013
  • 107. TWIG: OTHER WINS 2-way communication between UI and code. Thursday, April 11, 2013
  • 108. TWIG: OTHER WINS 2-way communication between UI and code. No broken UIs. Thursday, April 11, 2013
  • 109. TWIG: OTHER WINS 2-way communication between UI and code. No broken UIs. Template files can be created first, and the Drupal site can build itself* based on the presence and location of variables in the templates. *within reason Thursday, April 11, 2013
  • 110. THE NEW THEME LAYER IN DRUPAL 8 looks pretty awesome, right? Thursday, April 11, 2013
  • 112. HELP US GET THERE we need your help! we could be “done” in 1.5 weeks http://drupal.org/node/1757550 IRC: #drupal-twig Thursday, April 11, 2013
  • 113. THE NEW THEME LAYER IN DRUPAL 8 Jen Lampton ~ @jenlampton www.jenlampton.com Thursday, April 11, 2013
  • 114. photo credits: lolcat-flexible http://cheezburger.com/2679924736 anything is possible pebbles http://www.invergordontours.com/aip.html lolcat questionmark http://icanhascheezburger.com/2007/10/31/11197/ 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 twig docs screenshots http://twig.sensiolabs.org/documentation twig speed graphs http://phpcomparison.net/ python icon http://python-hosting.org/ ruby icon http://itmediaconnect.ro/en/web django logo http://py-arahat.blogspot.com/2010/08/django-vs-pylons.html symfony logo http://symfony.com/logo scotch glass http://www.thespir.it/articles/scotch-101/?viewall=1 speech bubble http://ljtfash.blogspot.com/2012/10/youre-beautiful-no-matter-what-they-say.html Thursday, April 11, 2013