SlideShare a Scribd company logo
1 of 24
Download to read offline
june 2 0 1 1




THEME LIKE A MONSTER
        MAREK SOTAK | ATOMIC ANT

                 www.atomicant.co.uk
OH HAI!
ABOUT ME & ATOMIC ANT



 ● Web designer, developer
 ● Over 5 years with Drupal - since v4.6
 ● International team
 ● active in Drupal community - rootcandy, organising
   events
@sotak -- http://sotak.co.uk - http://atomicant.co.uk
DREAM JOB!
NOT REALLY



 ● They've called in
 ● Job I didn't really want to do
 ● Little tweaks, that's what they've said
DREAM JOB!
NOT REALLY
DREAM JOB!
NOT REALLY
DREAM JOB!
NOT REALLY
OH WELL
OH YEAH



 ● theme in /themes folder
 ● multisite approach? no? - http://drupal.org/node/53705
OH WELL
OH YEAH



 ● cloning Garland (any contrib theme - how to)
 ● you better sub-theme! - http://drupal.org/node/225125
LIKE A SHERLOCK
OH YEAH



 ● Ctrl+U, browsing the theme's folder, wait...
LIKE A SHERLOCK
OH YEAH



 ● 109 files? structure?




                           Problem?
LIKE A SHERLOCK
OH YEAH
THAT MOMENT
NIGHTMARE NO. 1



  ● How many libraries you have? Sorry?
  ● elmstreet.info




jsearchbox.js - custom js, copied? a js function getElementsByClassName?
HARDCODED
NIGHTMARE NO. 2



 ● hardcoded <link>s and <script>s
   <head>
   <?php print $head ?>
   <title><?php print $head_title ?></title>
   <link type="text/css" rel="stylesheet" media="all" href="<?php echo base_path() .
   path_to_theme();?>/common.css?G" />
   <link type="text/css" rel="stylesheet" media="all" href="<?php echo base_path() .
   path_to_theme();?>/style.css?G" />
   <link type="text/css" rel="stylesheet" media="all" href="<?php echo base_path() .
   path_to_theme();?>/pc-menu.css?G" />
    <?php print $scripts ?>
   </head>
HARDCODED
NIGHTMARE NO. 2



 ● no $styles variable?
 ● how about drupal/modules css?
 ● aggregation?
 ● exception hardcoded link - conditional stylesheets




 ● want to remove styles? do it in .info file
 stylesheets[all][] = system-menus.css
 hook_css_alter();
$CLOSURE
NIGHTMARE NO. 3



 ● page.tpl.php

   </div>
   <?php require_once($_SERVER['DOCUMENT_ROOT']
   ."/themes/elmstreet/google_analytics.php");
   ?>
   </body>
   </html>
 ● oh, you already have google analytics module?
C A M P B L O O D F R I D A Y 1 3 th
NIGHTMARE NO. 4



 ● template.php




 ● Copy, paste but THINK!
C A M P B L O O D F R I D A Y 1 3 th
NIGHTMARE NO. 4



 ● functions like garland_xxx - leftovers
 ● custom functions get_user(), groupdetails(),...
     ○ _mytheme_get_user(), mytheme_groupdetails()
SQL QUERIES
NIGHTMARE NO. 5




                  JUST DON'T
FORM API MISUSE
NIGHTMARE NO. 6



 ● Oh Hai "elmstreet_mysearchform" in template.php
 ● FAPI syntax, returns form array - but where is this being
   called from?




 ● in page.tpl.php via drupal_get_form?
UNEXPLAINABLE
NIGHTMARE NO. 7



 ● Remember?
 ● So they probably wanted to have a template suggestions
   for specific pages incl. headers
UNEXPLAINABLE
NIGHTMARE NO. 7



<?php $nodenid = $node->nid; ?>
<?php if ($nodenid == '142') { include('page_mpffe.tpl.php'); return; } ?>
<?php if ($nodenid == '131') { include('page_sca.tpl.php'); return; } ?>
<?php if ($override == 'mpffe') { include('page_mpffe_other.tpl.php');
return; } ?>
<?php if ($override == 'sca') { include('page_sca_other.tpl.php'); return; } ?>
<?php if ($override == 'cppce') { include('page_cppce_other.tpl.php'); return;
} ?>
<?php if ($override == 'ankpg') { include('page_ankpg_other.tpl.php');
return; } ?>
UNEXPLAINABLE
NIGHTMARE NO. 7



 ● we have custom suggestions
    ○ D6 - template_files, template_file
    ○ D7 - $variables['theme_hook_suggestions']
OKAY
CONCLUSION
QUESTIONS
GOT ANY NIGHTMARES?



twitter: @sotak
http://sotak.co.uk
http://atomicant.co.uk

More Related Content

What's hot

Word press templates
Word press templatesWord press templates
Word press templatesDan Phiffer
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeAdolfo Nasol
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme KickstartPeter
 
i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016Sergey Biryukov
 
Designing Firefox Themes
Designing Firefox ThemesDesigning Firefox Themes
Designing Firefox ThemesLim Chee Aun
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Laura Scott
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 
WordPress theme frameworks
WordPress theme frameworksWordPress theme frameworks
WordPress theme frameworksEddie Johnston
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme SystemPeter Arato
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibilityjsmith92
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingRobert Carr
 
Creating Themes
Creating ThemesCreating Themes
Creating ThemesDaisyOlsen
 
Writing PHP – The WordPress Way! by Rahul Bansal @WordCamp Mumbai 2017
Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Writing PHP – The WordPress Way! by Rahul Bansal @WordCamp Mumbai 2017rtCamp
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme DevelopmentWisdmLabs
 
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapАндрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapDrupalSPB
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme developmentThad Allender
 

What's hot (20)

Word press templates
Word press templatesWord press templates
Word press templates
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 Theme
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme Kickstart
 
i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016
 
Designing Firefox Themes
Designing Firefox ThemesDesigning Firefox Themes
Designing Firefox Themes
 
Design to Theme @ CMSExpo
Design to Theme @ CMSExpoDesign to Theme @ CMSExpo
Design to Theme @ CMSExpo
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Using Core Themes in Drupal 8
Using Core Themes in Drupal 8Using Core Themes in Drupal 8
Using Core Themes in Drupal 8
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
WordPress theme frameworks
WordPress theme frameworksWordPress theme frameworks
WordPress theme frameworks
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Drupal theming
Drupal themingDrupal theming
Drupal theming
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
Creating Themes
Creating ThemesCreating Themes
Creating Themes
 
Writing PHP – The WordPress Way! by Rahul Bansal @WordCamp Mumbai 2017
Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Writing PHP – The WordPress Way! by Rahul Bansal @WordCamp Mumbai 2017
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapАндрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
 

Similar to Theme like a monster #ddceu

Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Emma Jane Hogbin Westby
 
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
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Drupal7 Release Party in Luxembourg
Drupal7 Release Party in LuxembourgDrupal7 Release Party in Luxembourg
Drupal7 Release Party in Luxembourgnvisionagency
 
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCRDrupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCRGaurav Mishra
 
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Jazkarta, Inc.
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to railsGo Asgard
 
i18n for Plugin and Theme Developers, Global WordPress Translation Day 3
i18n for Plugin and Theme Developers, Global WordPress Translation Day 3i18n for Plugin and Theme Developers, Global WordPress Translation Day 3
i18n for Plugin and Theme Developers, Global WordPress Translation Day 3Sergey Biryukov
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP frameworkDinh Pham
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 
Custom elements - An alternate Render API for decoupled Drupal
Custom elements - An alternate Render API for decoupled DrupalCustom elements - An alternate Render API for decoupled Drupal
Custom elements - An alternate Render API for decoupled Drupalnuppla
 
Turbogears Presentation
Turbogears PresentationTurbogears Presentation
Turbogears Presentationdidip
 
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional   w/ Apache Spark @ Scala Days NYCKeeping the fun in functional   w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional w/ Apache Spark @ Scala Days NYCHolden Karau
 

Similar to Theme like a monster #ddceu (20)

Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
Drupal Front End PHP
Drupal Front End PHPDrupal Front End PHP
Drupal Front End PHP
 
Forensic Theming - DrupalCon London
Forensic Theming - DrupalCon LondonForensic Theming - DrupalCon London
Forensic Theming - DrupalCon London
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
 
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 Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Drupal7 Release Party in Luxembourg
Drupal7 Release Party in LuxembourgDrupal7 Release Party in Luxembourg
Drupal7 Release Party in Luxembourg
 
The Themer's Toolkit
The Themer's ToolkitThe Themer's Toolkit
The Themer's Toolkit
 
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCRDrupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
 
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to rails
 
Drupal Render API
Drupal Render APIDrupal Render API
Drupal Render API
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
i18n for Plugin and Theme Developers, Global WordPress Translation Day 3
i18n for Plugin and Theme Developers, Global WordPress Translation Day 3i18n for Plugin and Theme Developers, Global WordPress Translation Day 3
i18n for Plugin and Theme Developers, Global WordPress Translation Day 3
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP framework
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
Custom elements - An alternate Render API for decoupled Drupal
Custom elements - An alternate Render API for decoupled DrupalCustom elements - An alternate Render API for decoupled Drupal
Custom elements - An alternate Render API for decoupled Drupal
 
Turbogears Presentation
Turbogears PresentationTurbogears Presentation
Turbogears Presentation
 
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional   w/ Apache Spark @ Scala Days NYCKeeping the fun in functional   w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
 

Recently uploaded

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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
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
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsZilliz
 
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
 

Recently uploaded (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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
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
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
 
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
 

Theme like a monster #ddceu

  • 1. june 2 0 1 1 THEME LIKE A MONSTER MAREK SOTAK | ATOMIC ANT www.atomicant.co.uk
  • 2. OH HAI! ABOUT ME & ATOMIC ANT ● Web designer, developer ● Over 5 years with Drupal - since v4.6 ● International team ● active in Drupal community - rootcandy, organising events @sotak -- http://sotak.co.uk - http://atomicant.co.uk
  • 3. DREAM JOB! NOT REALLY ● They've called in ● Job I didn't really want to do ● Little tweaks, that's what they've said
  • 7. OH WELL OH YEAH ● theme in /themes folder ● multisite approach? no? - http://drupal.org/node/53705
  • 8. OH WELL OH YEAH ● cloning Garland (any contrib theme - how to) ● you better sub-theme! - http://drupal.org/node/225125
  • 9. LIKE A SHERLOCK OH YEAH ● Ctrl+U, browsing the theme's folder, wait...
  • 10. LIKE A SHERLOCK OH YEAH ● 109 files? structure? Problem?
  • 12. THAT MOMENT NIGHTMARE NO. 1 ● How many libraries you have? Sorry? ● elmstreet.info jsearchbox.js - custom js, copied? a js function getElementsByClassName?
  • 13. HARDCODED NIGHTMARE NO. 2 ● hardcoded <link>s and <script>s <head> <?php print $head ?> <title><?php print $head_title ?></title> <link type="text/css" rel="stylesheet" media="all" href="<?php echo base_path() . path_to_theme();?>/common.css?G" /> <link type="text/css" rel="stylesheet" media="all" href="<?php echo base_path() . path_to_theme();?>/style.css?G" /> <link type="text/css" rel="stylesheet" media="all" href="<?php echo base_path() . path_to_theme();?>/pc-menu.css?G" /> <?php print $scripts ?> </head>
  • 14. HARDCODED NIGHTMARE NO. 2 ● no $styles variable? ● how about drupal/modules css? ● aggregation? ● exception hardcoded link - conditional stylesheets ● want to remove styles? do it in .info file stylesheets[all][] = system-menus.css hook_css_alter();
  • 15. $CLOSURE NIGHTMARE NO. 3 ● page.tpl.php </div> <?php require_once($_SERVER['DOCUMENT_ROOT'] ."/themes/elmstreet/google_analytics.php"); ?> </body> </html> ● oh, you already have google analytics module?
  • 16. C A M P B L O O D F R I D A Y 1 3 th NIGHTMARE NO. 4 ● template.php ● Copy, paste but THINK!
  • 17. C A M P B L O O D F R I D A Y 1 3 th NIGHTMARE NO. 4 ● functions like garland_xxx - leftovers ● custom functions get_user(), groupdetails(),... ○ _mytheme_get_user(), mytheme_groupdetails()
  • 19. FORM API MISUSE NIGHTMARE NO. 6 ● Oh Hai "elmstreet_mysearchform" in template.php ● FAPI syntax, returns form array - but where is this being called from? ● in page.tpl.php via drupal_get_form?
  • 20. UNEXPLAINABLE NIGHTMARE NO. 7 ● Remember? ● So they probably wanted to have a template suggestions for specific pages incl. headers
  • 21. UNEXPLAINABLE NIGHTMARE NO. 7 <?php $nodenid = $node->nid; ?> <?php if ($nodenid == '142') { include('page_mpffe.tpl.php'); return; } ?> <?php if ($nodenid == '131') { include('page_sca.tpl.php'); return; } ?> <?php if ($override == 'mpffe') { include('page_mpffe_other.tpl.php'); return; } ?> <?php if ($override == 'sca') { include('page_sca_other.tpl.php'); return; } ?> <?php if ($override == 'cppce') { include('page_cppce_other.tpl.php'); return; } ?> <?php if ($override == 'ankpg') { include('page_ankpg_other.tpl.php'); return; } ?>
  • 22. UNEXPLAINABLE NIGHTMARE NO. 7 ● we have custom suggestions ○ D6 - template_files, template_file ○ D7 - $variables['theme_hook_suggestions']
  • 24. QUESTIONS GOT ANY NIGHTMARES? twitter: @sotak http://sotak.co.uk http://atomicant.co.uk