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

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

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