SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Sherlock Markup and Sammy
Semantic


Name:       Andreas Sahle
drupal.org: pixelmord
twitter:    @pixelmord
Drupal Theming - Forensic
         analysis
Personas
                   „To be a good detective,
                   you have to think like a
                   criminal.”

„I‘d rather be a
gangster than a
criminal”
vs


A criminal is a gangster that got
            cought...
For a crime there is always

means, motive and
  opportunity
Motive
  the reason the defendant had
  to commit the crime

• Remove Markup / Hide stuff
• Change the markup
• Add JS/CSS files
• Alter the data
Hide something
configuration: hidden

             preprocess:
 [..][class][] = .element-invisible;
                                           display : none;

                     tpl: hide();


                                   Form API: #access
                                  Render API: unset ();
  .element-invisible
Opportunity

  whether or not the defendant
  had the chance to commit the
  crime

• configuration
• theme
• the APIs + hook_XXX_alter
Opportunity:
Configuration
Opportunity:
      Configuration



• theme configuration
• Fields UI / view mode
• node/comment configuration
• views/views field configuration
Opportunity:   Theme
Opportunity:     Theme


• preprocessing
• templates
• theme functions
• (hook_XXX_alter)
Opportunity:     Theme


• preprocessing
• templates
• theme functions
• (hook_XXX_alter)
Opportunity:    The APIs



• Field API
• Form API
• Render API
• hook_XXX_alter
Forensic analysis
• Firebug
• Theme developer
• Study similar crimes
              • Devel module
              • Search and inspect plus
                 RTFM

              • Study the master plan
Theme Developer




• Heads Up Display
• Inspect elements on site
• drupal.org/project/devel_themer
Similar crimes




• study ZEN and other base themes
check out the
 master plan


   • DEVEL the hell out of it
   • variables and Form/Render
     API

   • theme registry
dpm(‘everything‘);
Search, inspect, RTFM
• hook_theme();
• theme_function();
• XXX.tpl.php
• http://drupal.org/node/
  173880#theming-
  overrides
theme function call for Drupal 6.x
theme('hook', $arguments)                                                    http://api.drupal.org/api/function/theme/6


           [ load theme registry ]
           [ check hook for *wild cards ]

                 if hook is function

                             f.a themeName_hook($arguments)                   template.php
                                                                        or
                             f.b engineName_hook($arguments)                  .engine

                             f.c theme_hook($arguments)                 .module/.inc
                              [ default implementation as function ]


                         else hook is template

                                         [ convert $arguments into variables ]
                                         [ check for render function, defaults to theme_render_template ]
                                         [ check for extension function and run, defaults to ".tpl.php" ]
    preprocess functions
                                           template_preprocess                 theme.inc
                                                                                                              t.a
[ set variables & suggestions ]            template_preprocess_hook                .module/.inc

                                           moduleName_preprocess                        .module
 All variables passed by reference         moduleName_preprocess_hook                                         t.b
 between each preprocess function.
 As a result, variables are additive       engineName_engine_preprocess                           .engine
 building the variables array.
                                           engineName_engine_preprocess_hook                                  t.c

                                           engineName_preprocess                          template.php
                                           engineName_preprocess_hook                                         t.d
                                           themeName_preprocess
                                           themeName_preprocess_hook


                                         [ collect suggestions ]

                                           drupal_discover_template
                                           [ find implemented suggestion ]


                                           theme_render_template


                                            [ assemble .tpl.php file ]


        suggestion                       default hook


suggestion.tpl.php                         hook.tpl.php
 <html>                                     <html>
  <?php print $variable ?>                   <?php print $variable ?>
 </html>                                    </html>
Choose your weapon right,
Choose your weapon right,
theme function?

 
 
 
 
 
 
 
 
 
 
 
 template?
theme function?

 
 
 
 
 
 
 
 
 
 
 
 template?



   • theme function is faster
   • template is (pre)processed
Preprocessing




• gangstatheme_preprocess_block
• gangstatheme_preprocess_node
The second bullet




 • gangstatheme_process_page
„The onion
        analogy“
• Markup wraps data like an onion.



• The onion skins are produced in the
  different stages of the Drupal
  themeing process.
„The onion
        analogy“
• Markup wraps data like an onion.



• The onion skins are produced in the
  different stages of the Drupal
  themeing process.
Theming a field
Theming a block
#attached
Theming a form element
views theming




configure everything   /   flexible templates
Theming a field view
Thank you!

Name:       Andreas Sahle
drupal.org: pixelmord
twitter:    @pixelmord
image credits
 http://www.flickr.com/photos/nullvalue/4188517246/in/      http://www.flickr.com/photos/urban-spaceman/4311168437/in/
     gallery-31964157@N00-72157626883338113/                       gallery-31964157@N00-72157626883338113/


  http://www.flickr.com/photos/gregwake/209493486/in/
      gallery-31964157@N00-72157626883338113/               http://www.flickr.com/photos/dunechaser/2937238366/in/
                                                                  gallery-31964157@N00-72157626883338113/


 http://www.flickr.com/photos/ddalledo/807012017/in/          http://www.flickr.com/photos/elbragon/5455939124/in/
    gallery-31964157@N00-72157626883338113/                      gallery-31964157@N00-72157626883338113/


                                                           http://www.flickr.com/photos/mrcrash/823113691/in/
http://www.flickr.com/photos/mskogly/2405945004/               gallery-31964157@N00-72157626883338113/
 in/gallery-31964157@N00-72157626883338113/

                                                          http://www.flickr.com/photos/wondering_gypsy/3329497063/in/
                                                                  gallery-31964157@N00-72157626883338113/
 http://www.flickr.com/photos/johnmcnab/5499490056/
    in/gallery-31964157@N00-72157626883338113/
                                                             http://www.flickr.com/photos/geojanitor/2432843590/in/
                                                                  gallery-31964157@N00-72157626883338113/

http://www.flickr.com/photos/skimaskdude/4379613766/in/
       gallery-31964157@N00-72157626883338113/             http://www.flickr.com/photos/13218517@N00/3338928294/in/
                                                                   gallery-31964157@N00-72157627028472076/

http://www.flickr.com/photos/leonardlow/4337973246/in/
      gallery-31964157@N00-72157627028472076/
                                                            http://www.flickr.com/photos/bricknave/4419270183/in/
                                                                 gallery-31964157@N00-72157627028472076/
  http://www.flickr.com/photos/ben_lawson/2039198622/in/
        gallery-31964157@N00-72157627028472076/
                                                          http://www.flickr.com/photos/21232564@N06/2234726613/in/
                                                                  gallery-31964157@N00-72157627028472076/
   http://www.flickr.com/photos/wscullin/3770015991/in/
       gallery-31964157@N00-72157626883338113/
                                                           http://www.flickr.com/photos/dvdmerwe/5111063582/in/
                                                                gallery-31964157@N00-72157627028472076/
   http://www.flickr.com/photos/auntiep/17135231/in/
     gallery-31964157@N00-72157627028472076/

Weitere ähnliche Inhalte

Was ist angesagt?

A New Baseline for Front-End Devs
A New Baseline for Front-End DevsA New Baseline for Front-End Devs
A New Baseline for Front-End DevsRebecca Murphey
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitRebecca Murphey
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowVrann Tulika
 
Building Robust jQuery Plugins
Building Robust jQuery PluginsBuilding Robust jQuery Plugins
Building Robust jQuery PluginsJörn Zaefferer
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developersDream Production AG
 
Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Marko Heijnen
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaEduardo Shiota Yasuda
 
Making Sense of Twig
Making Sense of TwigMaking Sense of Twig
Making Sense of TwigBrandon Kelly
 
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009Krista Thomas
 
Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.jsJay Phelps
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009Remy Sharp
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2Javier Eguiluz
 
Maintainable JavaScript 2012
Maintainable JavaScript 2012Maintainable JavaScript 2012
Maintainable JavaScript 2012Nicholas Zakas
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 

Was ist angesagt? (20)

A New Baseline for Front-End Devs
A New Baseline for Front-End DevsA New Baseline for Front-End Devs
A New Baseline for Front-End Devs
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
Building Robust jQuery Plugins
Building Robust jQuery PluginsBuilding Robust jQuery Plugins
Building Robust jQuery Plugins
 
Hooks WCSD12
Hooks WCSD12Hooks WCSD12
Hooks WCSD12
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
 
Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
 
WCLV13 JavaScript
WCLV13 JavaScriptWCLV13 JavaScript
WCLV13 JavaScript
 
Celix universal OSGi
Celix universal OSGiCelix universal OSGi
Celix universal OSGi
 
Making Sense of Twig
Making Sense of TwigMaking Sense of Twig
Making Sense of Twig
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 
Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2
 
Maintainable JavaScript 2012
Maintainable JavaScript 2012Maintainable JavaScript 2012
Maintainable JavaScript 2012
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 

Andere mochten auch

Marky Markup and the Funky Bunch
Marky Markup and the Funky BunchMarky Markup and the Funky Bunch
Marky Markup and the Funky Bunchdtraft
 
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...Jim Birch
 
Drupal Presentation @ the Higher Education Web Symposium
Drupal Presentation @ the Higher Education Web SymposiumDrupal Presentation @ the Higher Education Web Symposium
Drupal Presentation @ the Higher Education Web SymposiumZivtech, LLC
 
Semantic Site Building (Drupal 7)
Semantic Site Building (Drupal 7)Semantic Site Building (Drupal 7)
Semantic Site Building (Drupal 7)jhamiltoorion
 
Breaking the Box: Pushing the Boundaries of UX with Drupal
Breaking the Box: Pushing the Boundaries of UX with DrupalBreaking the Box: Pushing the Boundaries of UX with Drupal
Breaking the Box: Pushing the Boundaries of UX with DrupalAcquia
 
Bootstrap Framework and Drupal
Bootstrap Framework and DrupalBootstrap Framework and Drupal
Bootstrap Framework and DrupalJim Birch
 

Andere mochten auch (8)

Marky Markup and the Funky Bunch
Marky Markup and the Funky BunchMarky Markup and the Funky Bunch
Marky Markup and the Funky Bunch
 
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
 
Drupal Presentation @ the Higher Education Web Symposium
Drupal Presentation @ the Higher Education Web SymposiumDrupal Presentation @ the Higher Education Web Symposium
Drupal Presentation @ the Higher Education Web Symposium
 
Semantic Site Building (Drupal 7)
Semantic Site Building (Drupal 7)Semantic Site Building (Drupal 7)
Semantic Site Building (Drupal 7)
 
Breaking the Box: Pushing the Boundaries of UX with Drupal
Breaking the Box: Pushing the Boundaries of UX with DrupalBreaking the Box: Pushing the Boundaries of UX with Drupal
Breaking the Box: Pushing the Boundaries of UX with Drupal
 
What Is Force
What Is ForceWhat Is Force
What Is Force
 
BEM it!
BEM it!BEM it!
BEM it!
 
Bootstrap Framework and Drupal
Bootstrap Framework and DrupalBootstrap Framework and Drupal
Bootstrap Framework and Drupal
 

Ähnlich wie Sherlock Markup and Sammy Semantic - drupal theming forensic analysis

Drupal Development
Drupal DevelopmentDrupal Development
Drupal DevelopmentJeff Eaton
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Emma Jane Hogbin Westby
 
8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8Logan Farr
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoJames Casey
 
國民雲端架構 Django + GAE
國民雲端架構 Django + GAE國民雲端架構 Django + GAE
國民雲端架構 Django + GAEWinston Chen
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
Rails + Sencha = Netzke
Rails + Sencha = NetzkeRails + Sencha = Netzke
Rails + Sencha = Netzkebeffa
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - LondonMarek Sotak
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes ramakesavan
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5jakemallory
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction DjangoWade Austin
 
Improve theming with (Twitter) Bootstrap
Improve theming with  (Twitter) BootstrapImprove theming with  (Twitter) Bootstrap
Improve theming with (Twitter) BootstrapAndrey Yurtaev
 
Functional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal ThemingFunctional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal ThemingEmma Jane Hogbin Westby
 

Ähnlich wie Sherlock Markup and Sammy Semantic - drupal theming forensic analysis (20)

Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
 
templates in Django material : Training available at Baabtra
templates in Django material : Training available at Baabtratemplates in Django material : Training available at Baabtra
templates in Django material : Training available at Baabtra
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
 
8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
國民雲端架構 Django + GAE
國民雲端架構 Django + GAE國民雲端架構 Django + GAE
國民雲端架構 Django + GAE
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Rails + Sencha = Netzke
Rails + Sencha = NetzkeRails + Sencha = Netzke
Rails + Sencha = Netzke
 
Django
DjangoDjango
Django
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction Django
 
Django crush course
Django crush course Django crush course
Django crush course
 
Twig
TwigTwig
Twig
 
Improve theming with (Twitter) Bootstrap
Improve theming with  (Twitter) BootstrapImprove theming with  (Twitter) Bootstrap
Improve theming with (Twitter) Bootstrap
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
 
Functional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal ThemingFunctional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal Theming
 
Drupal Front End PHP
Drupal Front End PHPDrupal Front End PHP
Drupal Front End PHP
 
Design to Theme @ CMSExpo
Design to Theme @ CMSExpoDesign to Theme @ CMSExpo
Design to Theme @ CMSExpo
 

Kürzlich hochgeladen

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Kürzlich hochgeladen (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Sherlock Markup and Sammy Semantic - drupal theming forensic analysis

  • 1. Sherlock Markup and Sammy Semantic Name: Andreas Sahle drupal.org: pixelmord twitter: @pixelmord
  • 2. Drupal Theming - Forensic analysis
  • 3. Personas „To be a good detective, you have to think like a criminal.” „I‘d rather be a gangster than a criminal”
  • 4. vs A criminal is a gangster that got cought...
  • 5. For a crime there is always means, motive and opportunity
  • 6. Motive the reason the defendant had to commit the crime • Remove Markup / Hide stuff • Change the markup • Add JS/CSS files • Alter the data
  • 8. configuration: hidden preprocess: [..][class][] = .element-invisible; display : none; tpl: hide(); Form API: #access Render API: unset (); .element-invisible
  • 9. Opportunity whether or not the defendant had the chance to commit the crime • configuration • theme • the APIs + hook_XXX_alter
  • 11. Opportunity: Configuration • theme configuration • Fields UI / view mode • node/comment configuration • views/views field configuration
  • 12. Opportunity: Theme
  • 13. Opportunity: Theme • preprocessing • templates • theme functions • (hook_XXX_alter)
  • 14. Opportunity: Theme • preprocessing • templates • theme functions • (hook_XXX_alter)
  • 15. Opportunity: The APIs • Field API • Form API • Render API • hook_XXX_alter
  • 16. Forensic analysis • Firebug • Theme developer • Study similar crimes • Devel module • Search and inspect plus RTFM • Study the master plan
  • 17. Theme Developer • Heads Up Display • Inspect elements on site • drupal.org/project/devel_themer
  • 18. Similar crimes • study ZEN and other base themes
  • 19. check out the master plan • DEVEL the hell out of it • variables and Form/Render API • theme registry
  • 21. Search, inspect, RTFM • hook_theme(); • theme_function(); • XXX.tpl.php • http://drupal.org/node/ 173880#theming- overrides
  • 22. theme function call for Drupal 6.x theme('hook', $arguments) http://api.drupal.org/api/function/theme/6 [ load theme registry ] [ check hook for *wild cards ] if hook is function f.a themeName_hook($arguments) template.php or f.b engineName_hook($arguments) .engine f.c theme_hook($arguments) .module/.inc [ default implementation as function ] else hook is template [ convert $arguments into variables ] [ check for render function, defaults to theme_render_template ] [ check for extension function and run, defaults to ".tpl.php" ] preprocess functions template_preprocess theme.inc t.a [ set variables & suggestions ] template_preprocess_hook .module/.inc moduleName_preprocess .module All variables passed by reference moduleName_preprocess_hook t.b between each preprocess function. As a result, variables are additive engineName_engine_preprocess .engine building the variables array. engineName_engine_preprocess_hook t.c engineName_preprocess template.php engineName_preprocess_hook t.d themeName_preprocess themeName_preprocess_hook [ collect suggestions ] drupal_discover_template [ find implemented suggestion ] theme_render_template [ assemble .tpl.php file ] suggestion default hook suggestion.tpl.php hook.tpl.php <html> <html> <?php print $variable ?> <?php print $variable ?> </html> </html>
  • 25. theme function? template?
  • 26. theme function? template? • theme function is faster • template is (pre)processed
  • 28. The second bullet • gangstatheme_process_page
  • 29. „The onion analogy“ • Markup wraps data like an onion. • The onion skins are produced in the different stages of the Drupal themeing process.
  • 30. „The onion analogy“ • Markup wraps data like an onion. • The onion skins are produced in the different stages of the Drupal themeing process.
  • 32.
  • 33.
  • 36. Theming a form element
  • 37.
  • 38. views theming configure everything / flexible templates
  • 40. Thank you! Name: Andreas Sahle drupal.org: pixelmord twitter: @pixelmord
  • 41. image credits http://www.flickr.com/photos/nullvalue/4188517246/in/ http://www.flickr.com/photos/urban-spaceman/4311168437/in/ gallery-31964157@N00-72157626883338113/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/gregwake/209493486/in/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/dunechaser/2937238366/in/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/ddalledo/807012017/in/ http://www.flickr.com/photos/elbragon/5455939124/in/ gallery-31964157@N00-72157626883338113/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/mrcrash/823113691/in/ http://www.flickr.com/photos/mskogly/2405945004/ gallery-31964157@N00-72157626883338113/ in/gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/wondering_gypsy/3329497063/in/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/johnmcnab/5499490056/ in/gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/geojanitor/2432843590/in/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/skimaskdude/4379613766/in/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/13218517@N00/3338928294/in/ gallery-31964157@N00-72157627028472076/ http://www.flickr.com/photos/leonardlow/4337973246/in/ gallery-31964157@N00-72157627028472076/ http://www.flickr.com/photos/bricknave/4419270183/in/ gallery-31964157@N00-72157627028472076/ http://www.flickr.com/photos/ben_lawson/2039198622/in/ gallery-31964157@N00-72157627028472076/ http://www.flickr.com/photos/21232564@N06/2234726613/in/ gallery-31964157@N00-72157627028472076/ http://www.flickr.com/photos/wscullin/3770015991/in/ gallery-31964157@N00-72157626883338113/ http://www.flickr.com/photos/dvdmerwe/5111063582/in/ gallery-31964157@N00-72157627028472076/ http://www.flickr.com/photos/auntiep/17135231/in/ gallery-31964157@N00-72157627028472076/

Hinweis der Redaktion

  1. My company is Wunderkraut.\nWe are based in Munich and do development, consulting and training for Drupal projects\n
  2. the session is about finding opportunities to do theming\nand which tools to use\n
  3. to be able to do all the cool theming stuff you have to do some detective work\n\n
  4. if you ask 5 people, themers or developers you will get 5 different answers ho to do theming\nwe are not talking about wrong or right\n
  5. means - the ability of the defendant to commit the crime\n
  6. change the default\nremove markup or sometimes whole chunks of themed output\n
  7. amazing how much time we spent hiding an removing stuff\n
  8. there are many levels in the theme layer where you have opportunity to act\n
  9. Opportunity is in various levels of drupal.\nThe deeper you go you get more power? Yes and No\nDeeper meens earlier most of the time\n
  10. the real power for the theming gangster is not open stage\n
  11. \n
  12. \n
  13. work on the master plan \n
  14. sammy likes....\nsherlock recommends ...\n
  15. \n
  16. example module\nfield formatter + field widget\n
  17. Render API also can be used for reordering\nRender API is very similar to Form API\n
  18. \n
  19. \n
  20. the developers point of view\n
  21. The severeness is determined by the amount of damage or casualties. \n
  22. actually in Drupal 7 you have preprocessing also for theme functions\n
  23. \n
  24. \n
  25. The onion is a good analogy because it&amp;#x2019;s easy and complex at the same time. \nIt&amp;#x2019;s easy because it&amp;#x2019;s just skin on top of skin all the way from inside out. \nBut its also complex, because the skins have different thickness and colour.\n
  26. Render array goes from top down, \nbut with markup I&amp;#x2018;m always thinking &amp;#x201E;inside out&amp;#x201C;\n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n