SlideShare a Scribd company logo
1 of 35
Download to read offline
Drupal 6 Theming
      John Albin Wilkins


    Drupal.org : JohnAlbin
   Twitter.com : @johnalbin
Designing for Drupal
    ! Overview of the Layer
      Drupal Theming

    ! Implementation Details
      ! Templates
      ! Preprocessors
      ! Base Themes
    ! Where to go for help
Theming Example
Theming Example
More Zen Examples
More Zen Examples
More Zen Examples
Drupal Design
<?php print "with some PHP" ?>

Drupal Design
Drupal’s Theme Layer
     (the big picture)
Example Theme
Structure of page.tpl.php
Structure of page.tpl.php

           CSS style sheets




                                Search box   .


                              Title
          Conditional Info


                 content
Where do page.tpl.php
variables come from?
What do you need to know?

             •   Your theme doesn’t need
                 all the templates

             •   You don’t need to learn
                 all the variables

             •   Let Drupal’s architecture
                 build parts of your theme
Copy, Override, Modify




Templates and CSS are pulled from lower layers.

  Unless they are overridden in your theme.
Preprocess Functions




 modify variables using a function:
[theme name]_preprocess_[hook]

 e.g. example_preprocess_page
Preprocess Functions


                                            Page Variable
                                            modifications




          modify variables using a function:
         [theme name]_preprocess_[hook]
                                         Node Variable
           e.g. example_preprocess_page   Additions


Put preprocess functions in your theme’s template.php
What was the part in
   the middle?
   http://drupal.org/theme-guide
Base Themes
 Powerful Frameworks for
Beginners and Power Users
Benefits of Base Themes
 •   You don’t have to build everything
     yourself. Copy, override, and modify only
     what you need to.
 •   Bug fixes.
     Others can fix any bugs in the base theme.
 •   New features.
     For contrib Themes, there will occasionally
     be new features.
 •   Support.
     If you have modified an existing theme,
     sometimes the only answer you will get to
     your support question is “Well, it works
     fine in the original theme.”
 •   Rapid Theme Development.
     Many things are built for you.
http://drupal.org/project/zen
Why use Zen?
•   Designed for beginners and Theming ninjas.

•   Extensive on-line documentation.

•   Step-by-step instructions on building your own sub-theme.

•   Extensive in-line comments in its PHP and CSS files.
Why use Zen?
•   Designed for beginners and Theming ninjas.

•   Extensive on-line documentation.

•   Step-by-step instructions on building your own sub-theme.

•   Extensive in-line comments in its PHP and CSS files.
Why use Zen?
•   Designed for beginners and Theming ninjas.

•   Extensive on-line documentation.

•   Step-by-step instructions on building your own sub-theme.

•   Extensive in-line comments in its PHP and CSS files.

•   It’s also got a laundry list of features. (which are exciting to use,
    but boring to list.)

•   A fantastically flexible CSS Layout method
    (that even works with IE5.5.)

•   The developer lives in Taiwan.
Brief overview of Zen’s Layout method

•   Source-ordered HTML: The importance of the pieces of content
    determines the order in HTML, and not the graphic design.

•   Flexible layout options:

    •   Fluid (100% width) or fixed-width layout

    •   Optional horizontal navbar

    •   1-3 columns built-in. More columns are possible without
        mind-bending contortions.

•   Zen’s default Layout Method is completely pluggable. If you don’t
    like it, just replace the layout.css file with your own layout
    method: YUI, YAML, Jello Mold, Holy Grail, etc.
Brief overview of Zen’s Layout method

•   Source-ordered HTML: The importance of the pieces of content
    determines the order in HTML, and not the graphic design.

•   Flexible layout options:

    •   Fluid (100% width) or fixed-width layout

    •   Optional horizontal navbar

    •   1-3 columns built-in. More columns are possible without
        mind-bending contortions.

•   Zen’s default Layout Method is completely pluggable. If you don’t
    like it, just replace the layout.css file with your own layout
    method: YUI, YAML, Jello Mold, Holy Grail, etc.
Brief overview of Zen’s Layout method

•   Source-ordered HTML: The importance of the pieces of content
    determines the order in HTML, and not the graphic design.

•   Flexible layout options:

    •   Fluid (100% width) or fixed-width layout

    •   Optional horizontal navbar

    •   1-3 columns built-in. More columns are possible without
        mind-bending contortions.

•   Zen’s default Layout Method is completely pluggable. If you don’t
    like it, just replace the layout.css file with your own layout
    method: YUI, YAML, Jello Mold, Holy Grail, etc.
Negative Margins
  (and positive results)




  ( These blocks have float: left; )
Negative Margins
  (and positive results)




  ( These blocks have float: left; )
Negative Margins
  (and positive results)




  ( These blocks have float: left; )
Negative Margins
  (and positive results)




  ( These blocks have float: left; )
Negative Margins
  (and positive results)




  ( These blocks have float: left; )
Negative Margins
  (and positive results)




  ( These blocks have float: left; )
Getting Help
 http://drupal.org/theme-guide
 http://drupal.org/project/zen
 http://drupal.org/irc
    #drupal-themes
    #drupal-support
    #drupal
 Ask Questions!

More Related Content

What's hot

WordPress Blogs 101
WordPress Blogs 101WordPress Blogs 101
WordPress Blogs 101Tom McGee
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtablecanarymason
 
Open Standards in the Walled Garden
Open Standards in the Walled GardenOpen Standards in the Walled Garden
Open Standards in the Walled Gardendigitalbindery
 
Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...
Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...
Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...Carlos Ospina
 
EPUB for Website Producers
EPUB for Website ProducersEPUB for Website Producers
EPUB for Website Producerswaldoj
 
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
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworksryngrn
 
Epub in the wild
Epub in the wildEpub in the wild
Epub in the wildliz_castro
 
Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010canarymason
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Thinkful
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themesChris Olbekson
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Campcanarymason
 
Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Daniel Friedman
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--devaltsav
 
Drupal Developer Skills (2012) - DrupalCamp LA 2012
Drupal Developer Skills (2012) - DrupalCamp LA 2012Drupal Developer Skills (2012) - DrupalCamp LA 2012
Drupal Developer Skills (2012) - DrupalCamp LA 2012Chris Charlton
 
Copywriting for seo
Copywriting for seoCopywriting for seo
Copywriting for seobrian9p
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress ThemesLaura Hartwig
 

What's hot (20)

WordPress Blogs 101
WordPress Blogs 101WordPress Blogs 101
WordPress Blogs 101
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtable
 
Open Standards in the Walled Garden
Open Standards in the Walled GardenOpen Standards in the Walled Garden
Open Standards in the Walled Garden
 
Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...
Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...
Convert a Site Template to a Drupal 7 Theme using SASS or LESS and Zurb Found...
 
EPUB for Website Producers
EPUB for Website ProducersEPUB for Website Producers
EPUB for Website Producers
 
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
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworks
 
Epub in the wild
Epub in the wildEpub in the wild
Epub in the wild
 
Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010
 
Color Me Flexible
Color Me FlexibleColor Me Flexible
Color Me Flexible
 
Web dev-101
Web dev-101Web dev-101
Web dev-101
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themes
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
 
Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
 
Drupal Developer Skills (2012) - DrupalCamp LA 2012
Drupal Developer Skills (2012) - DrupalCamp LA 2012Drupal Developer Skills (2012) - DrupalCamp LA 2012
Drupal Developer Skills (2012) - DrupalCamp LA 2012
 
Copywriting for seo
Copywriting for seoCopywriting for seo
Copywriting for seo
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress Themes
 

Viewers also liked

Lies, Damned Lies, and Remotely Hosted Encrypted Data
Lies, Damned Lies, and Remotely Hosted Encrypted DataLies, Damned Lies, and Remotely Hosted Encrypted Data
Lies, Damned Lies, and Remotely Hosted Encrypted DataGeorg Greve
 
Wee @ social media 011
Wee @ social media 011Wee @ social media 011
Wee @ social media 011WEE
 
PyJS intro
PyJS introPyJS intro
PyJS introDemix
 
A2 나만의 싸이월드 만들기
A2 나만의 싸이월드 만들기A2 나만의 싸이월드 만들기
A2 나만의 싸이월드 만들기NAVER D2
 
Furia de género: el transfeminismo como práctica política de lucha integrador...
Furia de género: el transfeminismo como práctica política de lucha integrador...Furia de género: el transfeminismo como práctica política de lucha integrador...
Furia de género: el transfeminismo como práctica política de lucha integrador...belenmaciascalvo
 
避免洗腎的秘方
避免洗腎的秘方避免洗腎的秘方
避免洗腎的秘方5045033
 
Nanxun old town, zhejiang (浙江 南潯古鎮)
Nanxun old town, zhejiang (浙江 南潯古鎮)Nanxun old town, zhejiang (浙江 南潯古鎮)
Nanxun old town, zhejiang (浙江 南潯古鎮)Chung Yen Chang
 

Viewers also liked (8)

Lies, Damned Lies, and Remotely Hosted Encrypted Data
Lies, Damned Lies, and Remotely Hosted Encrypted DataLies, Damned Lies, and Remotely Hosted Encrypted Data
Lies, Damned Lies, and Remotely Hosted Encrypted Data
 
Weibo, social media phenomenon in China
Weibo, social media phenomenon in ChinaWeibo, social media phenomenon in China
Weibo, social media phenomenon in China
 
Wee @ social media 011
Wee @ social media 011Wee @ social media 011
Wee @ social media 011
 
PyJS intro
PyJS introPyJS intro
PyJS intro
 
A2 나만의 싸이월드 만들기
A2 나만의 싸이월드 만들기A2 나만의 싸이월드 만들기
A2 나만의 싸이월드 만들기
 
Furia de género: el transfeminismo como práctica política de lucha integrador...
Furia de género: el transfeminismo como práctica política de lucha integrador...Furia de género: el transfeminismo como práctica política de lucha integrador...
Furia de género: el transfeminismo como práctica política de lucha integrador...
 
避免洗腎的秘方
避免洗腎的秘方避免洗腎的秘方
避免洗腎的秘方
 
Nanxun old town, zhejiang (浙江 南潯古鎮)
Nanxun old town, zhejiang (浙江 南潯古鎮)Nanxun old town, zhejiang (浙江 南潯古鎮)
Nanxun old town, zhejiang (浙江 南潯古鎮)
 

Similar to Nanocon Taiwan

Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...John Albin Wilkins
 
Rockford WordPress Meetup - Child Themes
Rockford WordPress Meetup - Child ThemesRockford WordPress Meetup - Child Themes
Rockford WordPress Meetup - Child ThemesAndrew Wikel
 
Drupal 7: Theming with Omega
Drupal 7: Theming with OmegaDrupal 7: Theming with Omega
Drupal 7: Theming with OmegaEric Sembrat
 
Child Themes and CSS in WordPress
Child Themes and CSS in WordPressChild Themes and CSS in WordPress
Child Themes and CSS in WordPressMatthew Vaccaro
 
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Romain Jarraud
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep diveRomain Jarraud
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an OverviewMatt Weaver
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design WorkshopFaye Tandog
 
full-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxfull-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxPlasterdog Web Design
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Pluginssuperann
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingRobert Carr
 
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
 
April 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesApril 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesEric Sembrat
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme developmentNaeem Junejo
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Laura Scott
 
Theming moodle technical
Theming moodle   technicalTheming moodle   technical
Theming moodle technicalAlex Walker
 
Advanced theming
Advanced themingAdvanced theming
Advanced themingtlattimore
 

Similar to Nanocon Taiwan (20)

Mastering zen
Mastering zenMastering zen
Mastering zen
 
Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...
 
Rockford WordPress Meetup - Child Themes
Rockford WordPress Meetup - Child ThemesRockford WordPress Meetup - Child Themes
Rockford WordPress Meetup - Child Themes
 
Drupal 7: Theming with Omega
Drupal 7: Theming with OmegaDrupal 7: Theming with Omega
Drupal 7: Theming with Omega
 
Child Themes and CSS in WordPress
Child Themes and CSS in WordPressChild Themes and CSS in WordPress
Child Themes and CSS in WordPress
 
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 
full-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxfull-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptx
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Plugins
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
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)
 
April 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesApril 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child Themes
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme development
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
 
Theming moodle technical
Theming moodle   technicalTheming moodle   technical
Theming moodle technical
 
Advanced theming
Advanced themingAdvanced theming
Advanced theming
 
Advanced theming
Advanced themingAdvanced theming
Advanced theming
 

More from John Albin Wilkins

Using the CSS Nesting Spec Today
Using the CSS Nesting Spec TodayUsing the CSS Nesting Spec Today
Using the CSS Nesting Spec TodayJohn Albin Wilkins
 
The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9John Albin Wilkins
 
CSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component designCSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component designJohn Albin Wilkins
 
Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!John Albin Wilkins
 
Styleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web DevelopmentStyleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web DevelopmentJohn Albin Wilkins
 
Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014John Albin Wilkins
 
DrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design ComponentsDrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design ComponentsJohn Albin Wilkins
 
SassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design ComponentsSassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design ComponentsJohn Albin Wilkins
 
Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)John Albin Wilkins
 
Mobile drupal: building a mobile theme
Mobile drupal: building a mobile themeMobile drupal: building a mobile theme
Mobile drupal: building a mobile themeJohn Albin Wilkins
 
Drupal and the Future of the Web
Drupal and the Future of the WebDrupal and the Future of the Web
Drupal and the Future of the WebJohn Albin Wilkins
 
Making Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme ManipulationsMaking Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme ManipulationsJohn Albin Wilkins
 

More from John Albin Wilkins (18)

Using the CSS Nesting Spec Today
Using the CSS Nesting Spec TodayUsing the CSS Nesting Spec Today
Using the CSS Nesting Spec Today
 
The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9
 
Mastering Drupal 8’s Twig
Mastering Drupal 8’s TwigMastering Drupal 8’s Twig
Mastering Drupal 8’s Twig
 
CSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component designCSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component design
 
Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!
 
Styleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web DevelopmentStyleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web Development
 
Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014
 
DrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design ComponentsDrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design Components
 
SassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design ComponentsSassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design Components
 
Drupal Camp Taipei Keynote
Drupal Camp Taipei KeynoteDrupal Camp Taipei Keynote
Drupal Camp Taipei Keynote
 
Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)
 
Mobile drupal: building a mobile theme
Mobile drupal: building a mobile themeMobile drupal: building a mobile theme
Mobile drupal: building a mobile theme
 
Sass: CSS with Attitude
Sass: CSS with AttitudeSass: CSS with Attitude
Sass: CSS with Attitude
 
Drupal and the Future of the Web
Drupal and the Future of the WebDrupal and the Future of the Web
Drupal and the Future of the Web
 
What's new in D7 Theming?
What's new in D7 Theming?What's new in D7 Theming?
What's new in D7 Theming?
 
Rocking the Theme Layer
Rocking the Theme LayerRocking the Theme Layer
Rocking the Theme Layer
 
Drupal Design Tips
Drupal Design TipsDrupal Design Tips
Drupal Design Tips
 
Making Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme ManipulationsMaking Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme Manipulations
 

Recently uploaded

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 

Recently uploaded (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 

Nanocon Taiwan

  • 1. Drupal 6 Theming John Albin Wilkins Drupal.org : JohnAlbin Twitter.com : @johnalbin
  • 2. Designing for Drupal ! Overview of the Layer Drupal Theming ! Implementation Details ! Templates ! Preprocessors ! Base Themes ! Where to go for help
  • 9. <?php print "with some PHP" ?> Drupal Design
  • 10. Drupal’s Theme Layer (the big picture)
  • 13. Structure of page.tpl.php CSS style sheets Search box . Title Conditional Info content
  • 15. What do you need to know? • Your theme doesn’t need all the templates • You don’t need to learn all the variables • Let Drupal’s architecture build parts of your theme
  • 16. Copy, Override, Modify Templates and CSS are pulled from lower layers. Unless they are overridden in your theme.
  • 17. Preprocess Functions modify variables using a function: [theme name]_preprocess_[hook] e.g. example_preprocess_page
  • 18. Preprocess Functions Page Variable modifications modify variables using a function: [theme name]_preprocess_[hook] Node Variable e.g. example_preprocess_page Additions Put preprocess functions in your theme’s template.php
  • 19. What was the part in the middle? http://drupal.org/theme-guide
  • 20. Base Themes Powerful Frameworks for Beginners and Power Users
  • 21. Benefits of Base Themes • You don’t have to build everything yourself. Copy, override, and modify only what you need to. • Bug fixes. Others can fix any bugs in the base theme. • New features. For contrib Themes, there will occasionally be new features. • Support. If you have modified an existing theme, sometimes the only answer you will get to your support question is “Well, it works fine in the original theme.” • Rapid Theme Development. Many things are built for you.
  • 23. Why use Zen? • Designed for beginners and Theming ninjas. • Extensive on-line documentation. • Step-by-step instructions on building your own sub-theme. • Extensive in-line comments in its PHP and CSS files.
  • 24. Why use Zen? • Designed for beginners and Theming ninjas. • Extensive on-line documentation. • Step-by-step instructions on building your own sub-theme. • Extensive in-line comments in its PHP and CSS files.
  • 25. Why use Zen? • Designed for beginners and Theming ninjas. • Extensive on-line documentation. • Step-by-step instructions on building your own sub-theme. • Extensive in-line comments in its PHP and CSS files. • It’s also got a laundry list of features. (which are exciting to use, but boring to list.) • A fantastically flexible CSS Layout method (that even works with IE5.5.) • The developer lives in Taiwan.
  • 26. Brief overview of Zen’s Layout method • Source-ordered HTML: The importance of the pieces of content determines the order in HTML, and not the graphic design. • Flexible layout options: • Fluid (100% width) or fixed-width layout • Optional horizontal navbar • 1-3 columns built-in. More columns are possible without mind-bending contortions. • Zen’s default Layout Method is completely pluggable. If you don’t like it, just replace the layout.css file with your own layout method: YUI, YAML, Jello Mold, Holy Grail, etc.
  • 27. Brief overview of Zen’s Layout method • Source-ordered HTML: The importance of the pieces of content determines the order in HTML, and not the graphic design. • Flexible layout options: • Fluid (100% width) or fixed-width layout • Optional horizontal navbar • 1-3 columns built-in. More columns are possible without mind-bending contortions. • Zen’s default Layout Method is completely pluggable. If you don’t like it, just replace the layout.css file with your own layout method: YUI, YAML, Jello Mold, Holy Grail, etc.
  • 28. Brief overview of Zen’s Layout method • Source-ordered HTML: The importance of the pieces of content determines the order in HTML, and not the graphic design. • Flexible layout options: • Fluid (100% width) or fixed-width layout • Optional horizontal navbar • 1-3 columns built-in. More columns are possible without mind-bending contortions. • Zen’s default Layout Method is completely pluggable. If you don’t like it, just replace the layout.css file with your own layout method: YUI, YAML, Jello Mold, Holy Grail, etc.
  • 29. Negative Margins (and positive results) ( These blocks have float: left; )
  • 30. Negative Margins (and positive results) ( These blocks have float: left; )
  • 31. Negative Margins (and positive results) ( These blocks have float: left; )
  • 32. Negative Margins (and positive results) ( These blocks have float: left; )
  • 33. Negative Margins (and positive results) ( These blocks have float: left; )
  • 34. Negative Margins (and positive results) ( These blocks have float: left; )
  • 35. Getting Help http://drupal.org/theme-guide http://drupal.org/project/zen http://drupal.org/irc #drupal-themes #drupal-support #drupal Ask Questions!