SlideShare a Scribd company logo
1 of 30
Download to read offline
What's new in 
Drupal 7 Theming
Marek Sotak
Who am I?
 Marek Sotak
  Drupal developer, themer and designer
  co-founder of Atomic Ant Ltd – http://atomicant.co.uk
  working with Drupal for about 5 years
  creator of admin theme RootCandy
  Lets Connect
    http://twitter.com/sotak
    http://sotak.co.uk
Back in the days
You won't believe me
It's that easy now
With D7 everyone can
Core themes massacre
They live in contrib, Garland escaped
New kids on the block
Seven, Bartik, Stark
Theme anatomy
.info
        No automatic
        loading for:
        script.js
        style.css

        Core themes
        only:
        package=core
html.tpl.php
               Single file with
               headers and
               wrappers
html.tpl.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
  "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print
$language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print
$language->dir; ?>"<?php print $rdf_namespaces; ?>>
<head profile="<?php print $grddl_profile; ?>">
  <?php print $head; ?>
                                   Common $classes variable that is being
  <title><?php print $head_title; ?></title>
  <?php print $styles; ?>           used everywhere, $attributes as well
  <?php print $scripts; ?>
</head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
  <div id="skip-link">
    <a href="#main-content"><?php print t('Skip to main content');
?></a>
  </div>
  <?php print $page_top; ?>
  <?php print $page; ?>             New Skip link for better (scope)
                                         region $page_top accessbility
  <?php print $page_bottom; ?>         Rendered page in $page
</body>                            $page_bottom replacing $closure
</html>
regions
 $missions variable removed
 ●   → regions[highlighted] = Highlighted
 $footer_message variable removed
 ●   → regions[footer] = Footer
 $content no longer as output
 ●   → region and is required
regions
 hidden regions
 ●   $page_top, $page_bottom
 ●   custom hidden region needs to be specified in .info:
       regions[indicators] = Indicators
       regions_hidden[] = indicators
 ●   Not displayed in blocks UI
 ●   Modules adds blocks directly into these regions
regions
 sidebars
 ●   $left region → $sidebar_first
 ●   $right → $sidebar_second
 help
 ●   $help → region
regions
 region.tpl.php

 <?php if($content): ?>
   <div class="<?php print $classes; ?>">
     <?php print $content; ?>
   </div>
 <?php endif; ?>
blocks
 Meaningful classes
 ●   block-user-0 → block-user-login
 ●   block-search-0 → block-search-form


 New blocks
 ●   $search_box → block
 ●   $content → block
 ●   $help → block
process & preprocess
 after preprocess we have post processing
 function
 both functions are available for tpl.php and for
 theme functions

  function bartik_process_html(&$variables) {
    // Hook into color.module.
    if (module_exists('color')) {
      _color_html_alter($variables);
    }
  }
hook_alter
 We can use _alter hooks in template.php
 ●   hook_form_alter
 ●   hook_css_alter
 ●   hook_page_alter
 ●   hook_xxx_alter
Don't be evil
Being evil is easier than ever
rendering
 New delivery callback
 Renderable array
hook_page_alter
Region in node.tpl, dynamic fields,...? easy
hide() & render()
 hide($content['field']);
   prevents content from rendering
 render($content);
   renders the $content
$classes_array
 HTML classes generated through a variable
 function mytheme_preprocess_node(&$vars) {
   // Add a striping class.
   $vars['classes_array'][] = 'node-' .
 $vars['zebra'];
 }

 Default template_process will flatten the
 classes_array into a string so in all templates
 we can use <?php print $classes ?>
PHPTemplate suggestions
●   page--user--%.tpl.php
●   page--user--edit.tpl.php, etc...
●   No need to have node.tpl.php in your theme
●   Using two dashes
●   node--article.tpl.php
●   page--front.tpl.php
Little big changes
 CSS
 ●   .clear-block → .clearfix
 ●   new classes for accessibility
     –   .element-hidden
     –   .element-invisible
 ●   default.css merged with system.css
 ●   new stylesheet system-behavior.css
 ●   conditional stylesheets
 function garland_preprocess_html(&$vars) {
   drupal_add_css(path_to_theme() . '/fix-ie.css', array('weight' =>
 CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE),
 'preprocess' => FALSE));
 }
worth mentioning
 PHPTemplate prefix is gone
   You are not able to use phptemplate_ prefix in your
   template.php file any more
worth mentioning
●   Primary and secondary links are now Main and
    Secondary menu
●   All theme() functions now take a single
    argument, $variables
●   new suggestions, specific menu items
    ●   THEMENAME_menu_link__MENU_NAME()
    ●   THEMENAME_menu_tree__MENU_NAME()
●   theme_link() - markup for l() function
jQuery, scripts
●   Drupal 7 ships with jQuery 1.4 & jQuery UI 1.8
●   Drupal.jsEnabled has been removed
●   drupal_add_js supports external scripts
●   #attached_js per element
resources
 Theme upgrade guide on d.org
   http://drupal.org/node/254940
 Moshe Weitzman's talk on drupal_render
   http://bit.ly/drupalrender
 John Albin's talk about D7 theming
   http://bit.ly/johnalbinsf
Questions?
And answers
Thank you!
 Credits for images
   slide 1 by Gilderic http://www.flickr.com/photos/gilderic/4405965973/sizes/o/
   slide 3 by isar21 http://www.flickr.com/photos/sriess/2244583403/sizes/o/
   slide 4 by jenburn http://www.flickr.com/photos/jenburn/255246409/sizes/o/
   slide 5 by Anakronik http://www.flickr.com/photos/nokianakronik/3054987717/sizes/o/
   slide 6 by dmc-flux http://www.flickr.com/photos/jackstiefel/3000208336/sizes/l/
   slide 7 by freeny http://freeny.deviantart.com/art/Sackboy-Anatomy-Wallpaper-117738222
   slide 18 by ???
   slide 20 by ???
   slide 6 by dmc-flux http://www.flickr.com/photos/jackstiefel/3000208336/sizes/l/

More Related Content

What's hot

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
 
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
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 
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
 
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
 
WordPress theme frameworks
WordPress theme frameworksWordPress theme frameworks
WordPress theme frameworksEddie Johnston
 
WordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a ThemeWordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a ThemeFadi Nicolas Zahhar
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaDre Armeda
 
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
 
Creating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without SwearingCreating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without Swearingmartinwolak
 
Dress Your WordPress with Child Themes
Dress Your WordPress with Child ThemesDress Your WordPress with Child Themes
Dress Your WordPress with Child ThemesLaurie M. Rauch
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme DevelopmentWisdmLabs
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentSitdhibong Laokok
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme developmentThad Allender
 
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapАндрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapDrupalSPB
 

What's hot (20)

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
 
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)
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
 
Drupal theming
Drupal themingDrupal theming
Drupal theming
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
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
 
WordPress theme frameworks
WordPress theme frameworksWordPress theme frameworks
WordPress theme frameworks
 
WordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a ThemeWordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a Theme
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
 
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
 
Creating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without SwearingCreating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without Swearing
 
Dress Your WordPress with Child Themes
Dress Your WordPress with Child ThemesDress Your WordPress with Child Themes
Dress Your WordPress with Child Themes
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
 
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapАндрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
 

Viewers also liked

Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.SWAAM Tech
 
Hire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel ProgrammersHire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel ProgrammersSummation IT
 
HFM Business Rule Writing Tips and Techniques
HFM Business Rule Writing Tips and TechniquesHFM Business Rule Writing Tips and Techniques
HFM Business Rule Writing Tips and TechniquesAlithya
 
Best Practices in HFM Application Design
Best Practices in HFM Application Design Best Practices in HFM Application Design
Best Practices in HFM Application Design Alithya
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)daylerees
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkBukhori Aqid
 
Hfm rule custom consolidation
Hfm rule custom consolidationHfm rule custom consolidation
Hfm rule custom consolidationAmit Sharma
 
Intro to Laravel PHP Framework
Intro to Laravel PHP FrameworkIntro to Laravel PHP Framework
Intro to Laravel PHP FrameworkBill Condo
 
Laravel 5 In Depth
Laravel 5 In DepthLaravel 5 In Depth
Laravel 5 In DepthKirk Bushell
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Vikas Chauhan
 

Viewers also liked (13)

Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.
 
Hire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel ProgrammersHire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel Programmers
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
HFM Business Rule Writing Tips and Techniques
HFM Business Rule Writing Tips and TechniquesHFM Business Rule Writing Tips and Techniques
HFM Business Rule Writing Tips and Techniques
 
Best Practices in HFM Application Design
Best Practices in HFM Application Design Best Practices in HFM Application Design
Best Practices in HFM Application Design
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP framework
 
Hfm rule custom consolidation
Hfm rule custom consolidationHfm rule custom consolidation
Hfm rule custom consolidation
 
Intro to Laravel PHP Framework
Intro to Laravel PHP FrameworkIntro to Laravel PHP Framework
Intro to Laravel PHP Framework
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Laravel 5 In Depth
Laravel 5 In DepthLaravel 5 In Depth
Laravel 5 In Depth
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
 

Similar to D7 theming what's new - London

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
 
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
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
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
 
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
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Siva Epari
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Developmentipsitamishra
 
Changes to Drupal Themes in version 7 (part 1)
Changes to Drupal Themes in version 7 (part 1)Changes to Drupal Themes in version 7 (part 1)
Changes to Drupal Themes in version 7 (part 1)Chris Charlton
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPressNile Flores
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Themingdrubb
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPressWalter Ebert
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress WebsitesKyle Cearley
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developersDream Production AG
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3giwoolee
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle themeKirill Borzov
 

Similar to D7 theming what's new - London (20)

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
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
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
 
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
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Development
 
Changes to Drupal Themes in version 7 (part 1)
Changes to Drupal Themes in version 7 (part 1)Changes to Drupal Themes in version 7 (part 1)
Changes to Drupal Themes in version 7 (part 1)
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Theming
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPress
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
 
Drupal Render API
Drupal Render APIDrupal Render API
Drupal Render API
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle theme
 

Recently uploaded

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
 
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
 
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
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
[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
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
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
 
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
 
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
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: 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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
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
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

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
 
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
 
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
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
[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
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
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
 
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
 
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...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: 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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
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
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

D7 theming what's new - London

  • 2. Who am I? Marek Sotak Drupal developer, themer and designer co-founder of Atomic Ant Ltd – http://atomicant.co.uk working with Drupal for about 5 years creator of admin theme RootCandy Lets Connect http://twitter.com/sotak http://sotak.co.uk
  • 5. Core themes massacre They live in contrib, Garland escaped
  • 8. .info No automatic loading for: script.js style.css Core themes only: package=core
  • 9. html.tpl.php Single file with headers and wrappers
  • 10. html.tpl.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>> <head profile="<?php print $grddl_profile; ?>"> <?php print $head; ?> Common $classes variable that is being <title><?php print $head_title; ?></title> <?php print $styles; ?> used everywhere, $attributes as well <?php print $scripts; ?> </head> <body class="<?php print $classes; ?>" <?php print $attributes;?>> <div id="skip-link"> <a href="#main-content"><?php print t('Skip to main content'); ?></a> </div> <?php print $page_top; ?> <?php print $page; ?> New Skip link for better (scope) region $page_top accessbility <?php print $page_bottom; ?> Rendered page in $page </body> $page_bottom replacing $closure </html>
  • 11. regions $missions variable removed ● → regions[highlighted] = Highlighted $footer_message variable removed ● → regions[footer] = Footer $content no longer as output ● → region and is required
  • 12. regions hidden regions ● $page_top, $page_bottom ● custom hidden region needs to be specified in .info: regions[indicators] = Indicators regions_hidden[] = indicators ● Not displayed in blocks UI ● Modules adds blocks directly into these regions
  • 13. regions sidebars ● $left region → $sidebar_first ● $right → $sidebar_second help ● $help → region
  • 14. regions region.tpl.php <?php if($content): ?> <div class="<?php print $classes; ?>"> <?php print $content; ?> </div> <?php endif; ?>
  • 15. blocks Meaningful classes ● block-user-0 → block-user-login ● block-search-0 → block-search-form New blocks ● $search_box → block ● $content → block ● $help → block
  • 16. process & preprocess after preprocess we have post processing function both functions are available for tpl.php and for theme functions function bartik_process_html(&$variables) { // Hook into color.module. if (module_exists('color')) { _color_html_alter($variables); } }
  • 17. hook_alter We can use _alter hooks in template.php ● hook_form_alter ● hook_css_alter ● hook_page_alter ● hook_xxx_alter
  • 18. Don't be evil Being evil is easier than ever
  • 19. rendering New delivery callback Renderable array
  • 20. hook_page_alter Region in node.tpl, dynamic fields,...? easy
  • 21. hide() & render() hide($content['field']); prevents content from rendering render($content); renders the $content
  • 22. $classes_array HTML classes generated through a variable function mytheme_preprocess_node(&$vars) { // Add a striping class. $vars['classes_array'][] = 'node-' . $vars['zebra']; } Default template_process will flatten the classes_array into a string so in all templates we can use <?php print $classes ?>
  • 23. PHPTemplate suggestions ● page--user--%.tpl.php ● page--user--edit.tpl.php, etc... ● No need to have node.tpl.php in your theme ● Using two dashes ● node--article.tpl.php ● page--front.tpl.php
  • 24. Little big changes CSS ● .clear-block → .clearfix ● new classes for accessibility – .element-hidden – .element-invisible ● default.css merged with system.css ● new stylesheet system-behavior.css ● conditional stylesheets function garland_preprocess_html(&$vars) { drupal_add_css(path_to_theme() . '/fix-ie.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE)); }
  • 25. worth mentioning PHPTemplate prefix is gone You are not able to use phptemplate_ prefix in your template.php file any more
  • 26. worth mentioning ● Primary and secondary links are now Main and Secondary menu ● All theme() functions now take a single argument, $variables ● new suggestions, specific menu items ● THEMENAME_menu_link__MENU_NAME() ● THEMENAME_menu_tree__MENU_NAME() ● theme_link() - markup for l() function
  • 27. jQuery, scripts ● Drupal 7 ships with jQuery 1.4 & jQuery UI 1.8 ● Drupal.jsEnabled has been removed ● drupal_add_js supports external scripts ● #attached_js per element
  • 28. resources Theme upgrade guide on d.org http://drupal.org/node/254940 Moshe Weitzman's talk on drupal_render http://bit.ly/drupalrender John Albin's talk about D7 theming http://bit.ly/johnalbinsf
  • 30. Thank you! Credits for images slide 1 by Gilderic http://www.flickr.com/photos/gilderic/4405965973/sizes/o/ slide 3 by isar21 http://www.flickr.com/photos/sriess/2244583403/sizes/o/ slide 4 by jenburn http://www.flickr.com/photos/jenburn/255246409/sizes/o/ slide 5 by Anakronik http://www.flickr.com/photos/nokianakronik/3054987717/sizes/o/ slide 6 by dmc-flux http://www.flickr.com/photos/jackstiefel/3000208336/sizes/l/ slide 7 by freeny http://freeny.deviantart.com/art/Sackboy-Anatomy-Wallpaper-117738222 slide 18 by ??? slide 20 by ??? slide 6 by dmc-flux http://www.flickr.com/photos/jackstiefel/3000208336/sizes/l/