SlideShare a Scribd company logo
1 of 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?

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

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.

Editor's Notes

  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