SlideShare una empresa de Scribd logo
1 de 29
Introductory Drupal Theme
      Development
         by Sheena Donnelly

       DrupalCamp Atlanta
       September 18, 2009
Introductions
I am…                          You are…
I. Graphic Designer & Front-   I. Front End Developer
   End Developer               II.Intermediate-level
II.10+ mos. Drupal                HTML/CSS skills
   Experience                  III.Basic Familiarity with
                                  PHP
III.Co-organizer of triDUG
                               IV.Bonus Points: Familiar
IV.Lead Web Designer              with Drupal Admin
  at Coalmarch
Part I

Introduction to the Drupal
       Theme Layer
What is a Drupal Theme?
I. HTML, CSS and PHP
II..info File
    • Basic Settings of
      Theme
III. .tpl.php Files
    • Templates
IV. .css and .js files
    • For spice and
      everything nice
V.Template.php
    • For advanced stuff
Where the Theme Lives
.info
I. Holds basic information
   about the theme.
   • Name
   • Drupal Version and
     Theme Engine
   • Declares base theme (if
     applicable)
   • Declares Regions
   • Declares CSS files
   • Declares JS files
Regions
I. Main page-layout
   elements
II.Blocks are Placed into
   Regions
   • Blocks are pieces of
     content generated by
     various modules
III.Provides a variable of the
   same name in the
   page.tpl.php file
IV.Use fewest Regions
  needed to avoid
  performance issues
CSS Files
I. Declared in the .info file or added
   by drupal_add_css()
    • Drupal core organizes the
      cascade of CSS files
    • Drupal can compress CSS for
      faster load
II. Style.css automatically declared
    for every theme
III.Conditional Stylesheets can be
    added w/ help from Conditional
    Stylesheets module
    • Some themes support this
      feature natively
Javascript Files
I. Declared in the .info file or
   added by drupal_add_js()
   • Drupal can compress
     javascript for faster
     load
II.Drupal Core includes
   JQuery
III. script.js automatically
   decalred for all themes
page.tpl.php
I.     HTML template for all
       pages
II.    Receives and displays
       content from Node,
       Regions and some
       modules
III.   Requires a basic
       understanding of PHP to
       read
Other Templates
I. node.tpl.php
   • Becomes the $content
     variable on node pages
   • Specificity:
     node-type.tpl.php
II.block.tpl.php,
  comment.tpl.php, etc.
III.Copy any .tpl.php file
  from a module into your
  theme to customize the
  HTML output of the
  module
Theme Settings Page
I. Toggle use of certain
   variables
  • Customizable per
    theme
II.Toggle use of post
   information by node type
  • Global Only
III.Upload $site_logo and
   favicon images
Site Information Page
I. Input site information
  • $site_name
  • $site_slogan
  • $mission
  • $footer_message
II.Set which node is
   displayed as the
   Homepage
Part II

PSD to Page.tpl.php
Basic Page Variables
I. Regions                     III. Important System
   • $header, $left, $right,        Variables
     $content, $footer             • $head, $head_title,
II. Theme Settings Variables         $styles, $scripts,
                                     $title, $tabs,
   • $site_name,
                                     $messages,
     $site_slogan, $logo,            $feed_icons,
     $primary_links,                 $closure
     $secondary_links,
     $mission,                 IV. Most of these variables
     $footer_message,              are HTML strings
     $search_box
Additional Page Variables
I. Utility Variables
   • Let you check for some
     state of the current page
   • Ex. - $is_front is used
     to check if the current
     page is the homepage.
II.Metadata Variables
   • Ex. - $body_classes sets
     classes on the <body>
     like is_front, page_node,
     node_type_blog, etc.
Relating Elements of a Design to
Page Variables
I. Isolate elements that   III. Create new regions
   are unique to each           in .info file if
   page from elements           necessary
   that will be shared
   between pages           IV. Finally, format the
                               HTML layout of
II.Determine which             elements in
   shared elements will        page.tpl.php to
   be blocks and which         reflect your site
   blocks share a region       design
Isolating Elements - PSD Comp
Isolating Elements   Regions and other Variables
Isolating Elements   Blocks within Regions

PSD Comp             Blocks Admin Page
Using Variables in page.tpl.php
Part III

 Tools, Tips and
Recommendations
Popular Base Themes
I. Zen - http://drupal.org/
  project/zen
    • The best “starter”
      theme.
    • Very well
      documented and
      supported
    • Fluid and Fixed
      layout options
    • Development Options
Popular Base Themes
II.       Blueprint - http://drupal.org/
          project/blueprint

      •        More advanced base
               theme
      •        24-column grid
               system
      •        Widths of various
               regions can changed
               based on other
               regions
      •        Those settings
               contained in
               template.php
Popular Base Themes
III.       NineSixty - http://drupal.org/
           project/ninesixty

       •       Based on Popular 960.gs
               grid system.
       •       12 or 16 column layout
       •       Widths of various
               regions can changed
               based on other regions
       •       Uses ns() function in
               page.tpl.php to
               acomplish this
Ready-to-Use Themes
I.   www.drupal.org/project/Themes
II. www.topnotchthemes.com
III. www.adaptivethemes.com

IV. www.themeforest.com
V.   www.templatemoster.com
Essential Modules
I. Admin/Development   III. Taxonomy
   • Admin Menu           • Taxonomy Image
   • Devel                • Taxonomy Menu
   • Conditional       IV. Images
     Stylesheets          • Imagecache
II. Menu Help             • Imagecache Crop
   • Menu Icons           • Galleria
   • Menu Block           • Thickbox
   • Menu Trails       V. Other
   • Pathauto             • Block Class
   • Nice Menus           • Dynamic Rendering
Getting More Help
I. drupal.org theming guide
    • http://drupal.org/theme-guide
II.irc.freenode.net
    • #drupal-themes
    • #drupal-design
    • #drupal-support
    • #drupal-nc
III.
   http://mustardseedmedia.com/podcast
IV.
    http://boston.design4drupal.org/sessions
Thank You!
I. Check these sites for slides, links and more
   information later today!
  • www.coalmarch.com
  • www.sheenadonnelly.net

Más contenido relacionado

Similar a PSD to Drupal - Introductory Drupal Theming

Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
Lauren Roth
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
Mediacurrent
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
hernanibf
 
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
Emma Jane Hogbin Westby
 
Open Source Content Management Systems
Open Source Content Management SystemsOpen Source Content Management Systems
Open Source Content Management Systems
Matthew Turland
 

Similar a PSD to Drupal - Introductory Drupal Theming (20)

Drupal Theming for Developers
Drupal Theming for DevelopersDrupal Theming for Developers
Drupal Theming for Developers
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to Drupal
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
 
Design to Theme @ CMSExpo
Design to Theme @ CMSExpoDesign to Theme @ CMSExpo
Design to Theme @ CMSExpo
 
72d5drupal
72d5drupal72d5drupal
72d5drupal
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
 
Introduction to Drupal
Introduction to DrupalIntroduction to Drupal
Introduction to Drupal
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
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
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 
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
 
DOC Presentation by DOC Contractor Alison McCauley
DOC Presentation by DOC Contractor Alison McCauleyDOC Presentation by DOC Contractor Alison McCauley
DOC Presentation by DOC Contractor Alison McCauley
 
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
 
Twig in the Wild
Twig in the WildTwig in the Wild
Twig in the Wild
 
Produce and consume_linked_data_with_drupal
Produce and consume_linked_data_with_drupalProduce and consume_linked_data_with_drupal
Produce and consume_linked_data_with_drupal
 
Open Source Content Management Systems
Open Source Content Management SystemsOpen Source Content Management Systems
Open Source Content Management Systems
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
Drupal basics
Drupal basicsDrupal basics
Drupal basics
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 

Último

Último (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

PSD to Drupal - Introductory Drupal Theming

  • 1. Introductory Drupal Theme Development by Sheena Donnelly DrupalCamp Atlanta September 18, 2009
  • 2. Introductions I am… You are… I. Graphic Designer & Front- I. Front End Developer End Developer II.Intermediate-level II.10+ mos. Drupal HTML/CSS skills Experience III.Basic Familiarity with PHP III.Co-organizer of triDUG IV.Bonus Points: Familiar IV.Lead Web Designer with Drupal Admin at Coalmarch
  • 3. Part I Introduction to the Drupal Theme Layer
  • 4. What is a Drupal Theme? I. HTML, CSS and PHP II..info File • Basic Settings of Theme III. .tpl.php Files • Templates IV. .css and .js files • For spice and everything nice V.Template.php • For advanced stuff
  • 6. .info I. Holds basic information about the theme. • Name • Drupal Version and Theme Engine • Declares base theme (if applicable) • Declares Regions • Declares CSS files • Declares JS files
  • 7. Regions I. Main page-layout elements II.Blocks are Placed into Regions • Blocks are pieces of content generated by various modules III.Provides a variable of the same name in the page.tpl.php file IV.Use fewest Regions needed to avoid performance issues
  • 8. CSS Files I. Declared in the .info file or added by drupal_add_css() • Drupal core organizes the cascade of CSS files • Drupal can compress CSS for faster load II. Style.css automatically declared for every theme III.Conditional Stylesheets can be added w/ help from Conditional Stylesheets module • Some themes support this feature natively
  • 9. Javascript Files I. Declared in the .info file or added by drupal_add_js() • Drupal can compress javascript for faster load II.Drupal Core includes JQuery III. script.js automatically decalred for all themes
  • 10. page.tpl.php I. HTML template for all pages II. Receives and displays content from Node, Regions and some modules III. Requires a basic understanding of PHP to read
  • 11. Other Templates I. node.tpl.php • Becomes the $content variable on node pages • Specificity: node-type.tpl.php II.block.tpl.php, comment.tpl.php, etc. III.Copy any .tpl.php file from a module into your theme to customize the HTML output of the module
  • 12. Theme Settings Page I. Toggle use of certain variables • Customizable per theme II.Toggle use of post information by node type • Global Only III.Upload $site_logo and favicon images
  • 13. Site Information Page I. Input site information • $site_name • $site_slogan • $mission • $footer_message II.Set which node is displayed as the Homepage
  • 14. Part II PSD to Page.tpl.php
  • 15. Basic Page Variables I. Regions III. Important System • $header, $left, $right, Variables $content, $footer • $head, $head_title, II. Theme Settings Variables $styles, $scripts, $title, $tabs, • $site_name, $messages, $site_slogan, $logo, $feed_icons, $primary_links, $closure $secondary_links, $mission, IV. Most of these variables $footer_message, are HTML strings $search_box
  • 16. Additional Page Variables I. Utility Variables • Let you check for some state of the current page • Ex. - $is_front is used to check if the current page is the homepage. II.Metadata Variables • Ex. - $body_classes sets classes on the <body> like is_front, page_node, node_type_blog, etc.
  • 17. Relating Elements of a Design to Page Variables I. Isolate elements that III. Create new regions are unique to each in .info file if page from elements necessary that will be shared between pages IV. Finally, format the HTML layout of II.Determine which elements in shared elements will page.tpl.php to be blocks and which reflect your site blocks share a region design
  • 19. Isolating Elements Regions and other Variables
  • 20. Isolating Elements Blocks within Regions PSD Comp Blocks Admin Page
  • 21. Using Variables in page.tpl.php
  • 22. Part III Tools, Tips and Recommendations
  • 23. Popular Base Themes I. Zen - http://drupal.org/ project/zen • The best “starter” theme. • Very well documented and supported • Fluid and Fixed layout options • Development Options
  • 24. Popular Base Themes II. Blueprint - http://drupal.org/ project/blueprint • More advanced base theme • 24-column grid system • Widths of various regions can changed based on other regions • Those settings contained in template.php
  • 25. Popular Base Themes III. NineSixty - http://drupal.org/ project/ninesixty • Based on Popular 960.gs grid system. • 12 or 16 column layout • Widths of various regions can changed based on other regions • Uses ns() function in page.tpl.php to acomplish this
  • 26. Ready-to-Use Themes I. www.drupal.org/project/Themes II. www.topnotchthemes.com III. www.adaptivethemes.com IV. www.themeforest.com V. www.templatemoster.com
  • 27. Essential Modules I. Admin/Development III. Taxonomy • Admin Menu • Taxonomy Image • Devel • Taxonomy Menu • Conditional IV. Images Stylesheets • Imagecache II. Menu Help • Imagecache Crop • Menu Icons • Galleria • Menu Block • Thickbox • Menu Trails V. Other • Pathauto • Block Class • Nice Menus • Dynamic Rendering
  • 28. Getting More Help I. drupal.org theming guide • http://drupal.org/theme-guide II.irc.freenode.net • #drupal-themes • #drupal-design • #drupal-support • #drupal-nc III. http://mustardseedmedia.com/podcast IV. http://boston.design4drupal.org/sessions
  • 29. Thank You! I. Check these sites for slides, links and more information later today! • www.coalmarch.com • www.sheenadonnelly.net

Notas del editor

  1. smile, relax, slow down. you&amp;#x2019;ll be fine!!
  2. place contrib themes and modules in /sites/all to keep them separate from core. makes updating drupal core a much easier process!
  3. whether or not variables are called on the page template, they will be loaded, so even if you don&amp;#x2019;t use regions, they will cause a db query
  4. Mention how the general template (node.tpl.php) must be included in the theme if a specific template is used (node-type.tpl.php), even if the general template is unchanged.
  5. Some System Variables are special. Removing them may seem to make no difference, but they are important for Druapl functionality. $closure, $messages, $tabs and $head should always be included.