SlideShare una empresa de Scribd logo
1 de 29
Efficient theming
    for Drupal
About us

   @CedricS                •   Frontend Developers
   Cedric Spillebeen
                           •   Focus on Dev and UX
   @janyves                •   krimson.be
   Jan-yves Vanhaverbeke

   @elswens
   Els Wens
Agenda

•   Introduction
•   Optimal Design Input
•   From Design to Theme
•   Basic Frontend Performance
•   Questions?
Introduction

•   Drupal is a CMS.
•   Content-first approach.
•   Built by backend developers.

    “ The Views output contains a rich set of div
    tags allowing fine-grained CSS control over
    the output. ”
Introduction

•   Get optimal design input. (complete designs)
•   A way of working that leads to a Drupal
    theme that is flexible, maintainable and
    consistent.
•   Optimize the Frontend Performance.
Optimize design input
Problems with designs

•   A design is static but Drupal is flexible.
•   Not all pages will be designed.
•   Designs are rarely consistent.
•   A design reflects the ideal situation.
Solutions

•   Take out inconsistencies before the final
    delivery.
•   Check for feasibility.
•   Ask for a style guide.
Style guide

•   An overview of all recurring design elements.
•   A requirement for every CMS design.
•   A separate design with all elements in the
    site.
•   Leading in case of inconsistencies.
Style guide

•   Site elements:
    •   Navigations: including mouse-over and active states.

    •   One or more block templates.

    •   A pager.

    •   Message boxes: warning, confirmation and error.

    •   A form. Typically useful for the contact form.

    •   A list of the most important colors.
Style guide

•   Typography:
    •   Headings: H1, H2, H3 and H4.

    •   Links: color and (optional) underline. Also define a
        mouse-over state.

    •   Paragraph: for default text the line-height and space
        between text should be defined.

    •   Unordered list: How does an unordered list in content
        look?
From design to theme
Analyze the design

•   Print all designs.
•   Look for patterns:
    •   Image styles
    •   View Modes
•   Decide on HTML tags / classes / IDs
Optimize the HTML

•   Don’t just take what Drupal offers by default.
•   Case: Views + Panels + Display Suite.
Optimize the HTML

•   Don’t just take what Drupal offers by default.
•   Case: Views + Panels + Display Suite.
Optimize the HTML

•   Don’t just take what Drupal offers by default.
•   Case: Views + Panels + Display Suite.
Optimize the HTML

•   Don’t just take what Drupal offers by default.
•   Case: Views + Panels + Display Suite.
•   Use generic classes above IDs.
•   Replace module specific HTML.
First step

•   Get the basics right first!
•   Add a simple page with mixed typographical
    content.
•   Style all generic elements: header, footer,
    navigation, typography, colors, links etc.
Keep your CSS flexible

•   Work as generic as possible.


    .field
     vs
    .page-article #content
    div.node div.field-title
Keep your CSS flexible

•   Theme a visual element, not a Drupal
    module:


    .article-teaser
     vs
    .views-articles .views-
    row
Keep your CSS flexible

•   Dare to rework existing CSS as features are
    added.
Optimize your CSS

•   Remove Drupal and module CSS (see
    Frontend Performance).
•   Use Drupal CSS standards: http://drupal.org/
    node/302199
•   Use comments to add structure to your CSS.
    /*
     * Navigation
     */

    /* Sidebar Navigation */
Frontend Performance
Reduce download size

•   Clean up your HTML.
•   Gzip compression for HTML.
•   mod_expires in Apache.
•   Optimize your images: http://drupal.org/
    project/imageapi_optimize.
•   Use Image Styles and Image Resize Filter.
Reduce download size

•   Remove unused Drupal and module CSS
    and javascript:
    •   hook_css_alter()
    •   hook_js_alter()
•   Add page specific CSS and javascript:
    •   drupal_add_css()
    •   drupal_add_js()
Less HTTP requests

         •   Aggregate CSS and javascript.
         •   Combine different groups into one:
/**                                              /**
  * Implements hook_js_alter().                    * Implements hook_css_alter().
  */                                               */
function mymodule_js_alter(&$javascript) {       function mymodule_css_alter(&$css) {
   uasort($javascript, 'drupal_sort_css_js');       uasort($css, 'drupal_sort_css_js');
   $i = 0;                                          $i = 0;
   foreach ($javascript as $name => $script) {      foreach ($css as $name => $style) {
     $javascript[$name]['weight'] = $i++;             $css[$name]['weight'] = $i++;
     $javascript[$name]['group'] = JS_DEFAULT;        $css[$name]['group'] = CSS_DEFAULT;
     $javascript[$name]['every_page'] = FALSE;        $css[$name]['every_page'] = FALSE;
   }                                                }
}                                                }
Other

•   Move JS to the bottom in your html.tpl.php.
•   Use a CDN: http://drupal.org/project/cdn.
•   Test your site with Yslow.
Questions?

Más contenido relacionado

La actualidad más candente

Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointSahil Gandhi
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build themDick Olsson
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingJamie Schmid
 
How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014James Strang
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPressAnthony Montalbano
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinSuzanne Dergacheva
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation joilrahat
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to cssNeil Perlin
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designersPai-Cheng Tao
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Developmentmwrather
 
Internet Marketing Institute in Delhi
Internet Marketing Institute in DelhiInternet Marketing Institute in Delhi
Internet Marketing Institute in DelhiJessica Smith
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSSRuss Weakley
 
快速开发Css
快速开发Css快速开发Css
快速开发Csstbmallf2e
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 

La actualidad más candente (20)

Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build them
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
 
How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPress
 
HTML/CSS for WordPress
HTML/CSS for WordPressHTML/CSS for WordPress
HTML/CSS for WordPress
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
 
Less presentation
Less presentationLess presentation
Less presentation
 
Css
CssCss
Css
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to css
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designers
 
Css home
Css   homeCss   home
Css home
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
Internet Marketing Institute in Delhi
Internet Marketing Institute in DelhiInternet Marketing Institute in Delhi
Internet Marketing Institute in Delhi
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSS
 
快速开发Css
快速开发Css快速开发Css
快速开发Css
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 

Destacado

The Minimum Loveable Product
The Minimum Loveable ProductThe Minimum Loveable Product
The Minimum Loveable ProductUX Café
 
The Cloud Revolution
The Cloud RevolutionThe Cloud Revolution
The Cloud RevolutionAll Covered
 
AWIS Offers: ResponseNow Anywhere
AWIS Offers: ResponseNow AnywhereAWIS Offers: ResponseNow Anywhere
AWIS Offers: ResponseNow AnywhereAHCMCorp
 
Lies, Damn Lies and Social Statistics
Lies, Damn Lies and Social StatisticsLies, Damn Lies and Social Statistics
Lies, Damn Lies and Social StatisticsOgilvy Consulting
 
How to create a product that people love (in 12 weeks!)
How to create a product that people love (in 12 weeks!)How to create a product that people love (in 12 weeks!)
How to create a product that people love (in 12 weeks!)The Happy Startup School
 
10 common UX mistakes startups make (and how to avoid them)
10 common UX mistakes startups make (and how to avoid them) 10 common UX mistakes startups make (and how to avoid them)
10 common UX mistakes startups make (and how to avoid them) The Happy Startup School
 
The Case Behind User Experience
The Case Behind User ExperienceThe Case Behind User Experience
The Case Behind User ExperienceStefan Ivanov
 
The future of mobile apps
The future of mobile appsThe future of mobile apps
The future of mobile appsMonika Mikowska
 
SXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsSXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsOgilvy Consulting
 

Destacado (15)

The Minimum Loveable Product
The Minimum Loveable ProductThe Minimum Loveable Product
The Minimum Loveable Product
 
The Cloud Revolution
The Cloud RevolutionThe Cloud Revolution
The Cloud Revolution
 
AWIS Offers: ResponseNow Anywhere
AWIS Offers: ResponseNow AnywhereAWIS Offers: ResponseNow Anywhere
AWIS Offers: ResponseNow Anywhere
 
Lies, Damn Lies and Social Statistics
Lies, Damn Lies and Social StatisticsLies, Damn Lies and Social Statistics
Lies, Damn Lies and Social Statistics
 
Problems
ProblemsProblems
Problems
 
How to create a product that people love (in 12 weeks!)
How to create a product that people love (in 12 weeks!)How to create a product that people love (in 12 weeks!)
How to create a product that people love (in 12 weeks!)
 
LinxFIT 7 GDK UX Tips
LinxFIT 7 GDK UX TipsLinxFIT 7 GDK UX Tips
LinxFIT 7 GDK UX Tips
 
10 common UX mistakes startups make (and how to avoid them)
10 common UX mistakes startups make (and how to avoid them) 10 common UX mistakes startups make (and how to avoid them)
10 common UX mistakes startups make (and how to avoid them)
 
Facebook Reactions
Facebook ReactionsFacebook Reactions
Facebook Reactions
 
15 years of Shazam
15 years of Shazam15 years of Shazam
15 years of Shazam
 
The Case Behind User Experience
The Case Behind User ExperienceThe Case Behind User Experience
The Case Behind User Experience
 
Bots by Ogilvy
Bots by OgilvyBots by Ogilvy
Bots by Ogilvy
 
Point of Care Messaging
Point of Care MessagingPoint of Care Messaging
Point of Care Messaging
 
The future of mobile apps
The future of mobile appsThe future of mobile apps
The future of mobile apps
 
SXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsSXSW 2016: The Need To Knows
SXSW 2016: The Need To Knows
 

Similar a Efficient theming in Drupal

Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an OverviewMatt Weaver
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Mediacurrent
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Eugenio Minardi
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)Hajas Tamás
 
Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Acquia
 
Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overviewGill Cleeren
 
Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)Mike Schinkel
 
Designing True Cross-Platform Apps
Designing True Cross-Platform AppsDesigning True Cross-Platform Apps
Designing True Cross-Platform AppsFITC
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSTJ Stalcup
 
Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsSuzanne Dergacheva
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers PerspectiveMediacurrent
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDavid Lanier
 
New Adventures in Drupal Theming
New Adventures in Drupal ThemingNew Adventures in Drupal Theming
New Adventures in Drupal ThemingJohn Albin Wilkins
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme KickstartPeter
 
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreCreating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreSuzanne Dergacheva
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationMelanie Archer
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningGeorge Estebe
 

Similar a Efficient theming in Drupal (20)

Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)
 
Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2
 
Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overview
 
Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)
 
Designing True Cross-Platform Apps
Designing True Cross-Platform AppsDesigning True Cross-Platform Apps
Designing True Cross-Platform Apps
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
 
Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen Grids
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 version
 
New Adventures in Drupal Theming
New Adventures in Drupal ThemingNew Adventures in Drupal Theming
New Adventures in Drupal Theming
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme Kickstart
 
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreCreating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundation
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
 

Último

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Efficient theming in Drupal

  • 1. Efficient theming for Drupal
  • 2. About us @CedricS • Frontend Developers Cedric Spillebeen • Focus on Dev and UX @janyves • krimson.be Jan-yves Vanhaverbeke @elswens Els Wens
  • 3. Agenda • Introduction • Optimal Design Input • From Design to Theme • Basic Frontend Performance • Questions?
  • 4. Introduction • Drupal is a CMS. • Content-first approach. • Built by backend developers. “ The Views output contains a rich set of div tags allowing fine-grained CSS control over the output. ”
  • 5. Introduction • Get optimal design input. (complete designs) • A way of working that leads to a Drupal theme that is flexible, maintainable and consistent. • Optimize the Frontend Performance.
  • 7. Problems with designs • A design is static but Drupal is flexible. • Not all pages will be designed. • Designs are rarely consistent. • A design reflects the ideal situation.
  • 8. Solutions • Take out inconsistencies before the final delivery. • Check for feasibility. • Ask for a style guide.
  • 9. Style guide • An overview of all recurring design elements. • A requirement for every CMS design. • A separate design with all elements in the site. • Leading in case of inconsistencies.
  • 10. Style guide • Site elements: • Navigations: including mouse-over and active states. • One or more block templates. • A pager. • Message boxes: warning, confirmation and error. • A form. Typically useful for the contact form. • A list of the most important colors.
  • 11. Style guide • Typography: • Headings: H1, H2, H3 and H4. • Links: color and (optional) underline. Also define a mouse-over state. • Paragraph: for default text the line-height and space between text should be defined. • Unordered list: How does an unordered list in content look?
  • 12. From design to theme
  • 13.
  • 14. Analyze the design • Print all designs. • Look for patterns: • Image styles • View Modes • Decide on HTML tags / classes / IDs
  • 15. Optimize the HTML • Don’t just take what Drupal offers by default. • Case: Views + Panels + Display Suite.
  • 16. Optimize the HTML • Don’t just take what Drupal offers by default. • Case: Views + Panels + Display Suite.
  • 17. Optimize the HTML • Don’t just take what Drupal offers by default. • Case: Views + Panels + Display Suite.
  • 18. Optimize the HTML • Don’t just take what Drupal offers by default. • Case: Views + Panels + Display Suite. • Use generic classes above IDs. • Replace module specific HTML.
  • 19. First step • Get the basics right first! • Add a simple page with mixed typographical content. • Style all generic elements: header, footer, navigation, typography, colors, links etc.
  • 20. Keep your CSS flexible • Work as generic as possible. .field vs .page-article #content div.node div.field-title
  • 21. Keep your CSS flexible • Theme a visual element, not a Drupal module: .article-teaser vs .views-articles .views- row
  • 22. Keep your CSS flexible • Dare to rework existing CSS as features are added.
  • 23. Optimize your CSS • Remove Drupal and module CSS (see Frontend Performance). • Use Drupal CSS standards: http://drupal.org/ node/302199 • Use comments to add structure to your CSS. /* * Navigation */ /* Sidebar Navigation */
  • 25. Reduce download size • Clean up your HTML. • Gzip compression for HTML. • mod_expires in Apache. • Optimize your images: http://drupal.org/ project/imageapi_optimize. • Use Image Styles and Image Resize Filter.
  • 26. Reduce download size • Remove unused Drupal and module CSS and javascript: • hook_css_alter() • hook_js_alter() • Add page specific CSS and javascript: • drupal_add_css() • drupal_add_js()
  • 27. Less HTTP requests • Aggregate CSS and javascript. • Combine different groups into one: /** /** * Implements hook_js_alter(). * Implements hook_css_alter(). */ */ function mymodule_js_alter(&$javascript) { function mymodule_css_alter(&$css) { uasort($javascript, 'drupal_sort_css_js'); uasort($css, 'drupal_sort_css_js'); $i = 0; $i = 0; foreach ($javascript as $name => $script) { foreach ($css as $name => $style) { $javascript[$name]['weight'] = $i++; $css[$name]['weight'] = $i++; $javascript[$name]['group'] = JS_DEFAULT; $css[$name]['group'] = CSS_DEFAULT; $javascript[$name]['every_page'] = FALSE; $css[$name]['every_page'] = FALSE; } } } }
  • 28. Other • Move JS to the bottom in your html.tpl.php. • Use a CDN: http://drupal.org/project/cdn. • Test your site with Yslow.

Notas del editor

  1. \n
  2. \n
  3. \n
  4. Drupal is a CMS, thus flexible. \nBuilt by developers: the theming layer is super-flexible but very technical.\nContent-first approach: you have to build the site first, before you can start to theme. This is largely due to the fact that there are always several ways to achieve one goal, each with different HTML. So you can’t go from design to HTML without keeping Drupal HTML into account.\nQuote: one of the big issues in Drupal. Drupal 7 is already better, and Drupal 8 will be a lot better in this area.\n
  5. Let’s compare to backend development: there is Functional Analysis and Technical Analysis. But in most companies, Frontend Development is an afterthought. \n\nNot: these are great tools, but should not patch up a bad process. Get your basics right first.\n
  6. \n
  7. A design is static: but Drupal is a CMS, and thus flexible. It is difficult to visualize what will happen in case blocks are added, content grows longer etc.\nNot all pages will be designed: which is not always a bad thing. As this leads to the third point: the more designs, the more inconsistencies.\nDesigns are rarely consistent: and you cannot blame the designer, since designs go back and forth between designer and client.\nIdeal situation: teaser with right length, equal height blocks etc.\n
  8. Inconsistencies: Sit down with the designer, and take out the risks and inconsistencies.\nFeasibility: HAALBAARHEID: zijn er zaken die heel moeilijk of niet te bereiken zijn.\nStyle guide: see next slides. \n
  9. Leading: important to discuss this with the designer.\n
  10. \n
  11. \n
  12. NA DESIGN ANALYSE ==> GEOPTIMALISEERDE DESIGNS ==> START THEMING\n\nWAT IS THEMING?\n\nTHEMING VAAK ONDERSCHAT ==> MEER DAN KLEURTJES EN AFMETINGEN\n\nEIST DOORDACHTE AANPAK ==> CONSISTENTIE & FLEXIBILITEIT\n
  13. WE HADDEN VANDAAG NOG DISCUSSIE ==> 2x 1 onderdeel is consistentie\n
  14. Consistentie: Patronen, Afbeeldingsstijlen, weergave van content\n\nZet die consistentie om naar HTML => TAGS, CLASS & ID\n
  15. Remember that Drupal has a content-first approach, so the developer will fill the site with content and features. \nModule specific HTML: everything is overridable in Drupal so use that to make the HTML consistent. It will hugely improve the quality of your CSS.\n\nCase: we will compare a Default Drupal 7 with some Views and some content, and our optimized Drupal. For coolness, we will do a 3D comparison in Firefox.\n
  16. Remember that Drupal has a content-first approach, so the developer will fill the site with content and features. \nModule specific HTML: everything is overridable in Drupal so use that to make the HTML consistent. It will hugely improve the quality of your CSS.\n\nCase: we will compare a Default Drupal 7 with some Views and some content, and our optimized Drupal. For coolness, we will do a 3D comparison in Firefox.\n
  17. Remember that Drupal has a content-first approach, so the developer will fill the site with content and features. \nModule specific HTML: everything is overridable in Drupal so use that to make the HTML consistent. It will hugely improve the quality of your CSS.\n\nCase: we will compare a Default Drupal 7 with some Views and some content, and our optimized Drupal. For coolness, we will do a 3D comparison in Firefox.\n
  18. Remember that Drupal has a content-first approach, so the developer will fill the site with content and features. \nModule specific HTML: everything is overridable in Drupal so use that to make the HTML consistent. It will hugely improve the quality of your CSS.\n\nCase: we will compare a Default Drupal 7 with some Views and some content, and our optimized Drupal. For coolness, we will do a 3D comparison in Firefox.\n
  19. Start met de basis!\n
  20. Generic: it’s not about being sure it won’t break. It is about reusability and consistency.\n\nVisual element = an article teaser. Every module has its own output, such as Panels or Views, but don’t theme on it.\n
  21. Generic: it’s not about being sure it won’t break. It is about reusability and consistency.\n\nVisual element = an article teaser. Every module has its own output, such as Panels or Views, but don’t theme on it.\n
  22. Generic: it’s not about being sure it won’t break. It is about reusability and consistency.\n\nVisual element = an article teaser. Every module has its own output, such as Panels or Views, but don’t theme on it.\n
  23. \n
  24. We will only focus on the Drupal specifics here, not Frontend Performance in general.\n\nImportant for mobile devices. 20% server time and 80% client side.\n
  25. Gzip compression is available in Drupal, but you should do it on server level.\nmod_expires: Drupal adds cache expiration headers by default but you need to activate this Apache module.\nImage Styles: Image size presets.\nImage Resize Filter: solves the issue of huge images that are manually rescaled in the WYSIWYG.\n
  26. Every module adds its own CSS and possibly JS. Always check if you even use those files. \nOr if you feel like you are overwriting everything, think twice.\n\nDon’t stuff everything in your .info file.\n
  27. Aggregate: Configuration > Performance\nFewer HTTP requests are better than smaller files.\nCombine: SYSTEM, DEFAULT, THEME\n\nOther options such as sprites are also useful, but we want to focus on Drupal specific options.\n
  28. \n
  29. \n