SlideShare a Scribd company logo
Drupal 7 Theme System
Theme

http://drupal.org/project/themes
Theme from scratch
sites/default/themes/NAME

         NAME.info
name = My super theme
core = 7.x
engine = phptemplate
NAME.info
stylesheets[all][] = css/style.css
                                           all,
                                         print,
File                                  screen,
css/style.css                        projector
Webkit Inspector
       Firebug
IE Developers Toolbar
NAME.info
scripts[] = js/actions.js


File
js/actions.js
Regions
Name.info
regions[sidebar] = Sidebar
regions[ads_mini] = Small ads
regions[ads_big] = Big ads
                                            first,
                                sidebar second,
                                        content,
                                        header,
                                          footer,
                                    highlighted,
                                           help,
                                 page_bottom,
                                      page_top
NAME.info
settings[main_color] = 'orange'
theme-settings.php
theme_get_settings(VAR);
Templates
Overriding template files

          copy
Special template files
node--nodeid.tpl.php
node--type.tpl.php
node.tpl.php

block--module--delta.tpl.php
block--module.tpl.php
block--region.tpl.php

page.tpl.php
page--node.tpl.php
page--node--%.tpl.php
page--node--1.tpl.php
page--node--edit.tpl.php
page--front.tpl.php
                           http://drupal.org/node/1089656
Template function
theme(HOOK, ARGS[]);
      image
      item_list
      link
      links
      table
      username
      breadcrumb
      ...
Overriding template function
1. NAME_HOOK()
2. sites/default/themes/NAME/HOOK.tpl.php
3. theme_HOOK()
function mytheme_table($header, $rows, $args)
Preprocess functions
TEMPLATE_preprocess(&$variables, $hook)

TEMPLATE_preprocess_HOOK(&$variables)
Defining your own template
HOOK_theme()
Distributing content
Subtheme

http://drupal.org/node/225125

More Related Content

What's hot

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
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
Emma Jane Hogbin Westby
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
Marek Sotak
 

What's hot (20)

BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to theming
 
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
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 Theme
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme Kickstart
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
WordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopWordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 Workshop
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Theme guru's (Moodle 2 Edition)
Theme guru's (Moodle 2 Edition)Theme guru's (Moodle 2 Edition)
Theme guru's (Moodle 2 Edition)
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designers
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 

Similar to Drupal 7 Theme System

Theming Drupal: Beyond the Look and Feel
Theming Drupal: Beyond the Look and FeelTheming Drupal: Beyond the Look and Feel
Theming Drupal: Beyond the Look and Feel
Chris Albrecht
 
Pre process functions in template.php
Pre process functions in template.phpPre process functions in template.php
Pre process functions in template.php
Green For All
 
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
camp_drupal_ua
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
Lauren Roth
 

Similar to Drupal 7 Theme System (20)

Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
Oficina drupal - Temas Drupal (Theming)
Oficina drupal - Temas Drupal (Theming)Oficina drupal - Temas Drupal (Theming)
Oficina drupal - Temas Drupal (Theming)
 
Theming Drupal: Beyond the Look and Feel
Theming Drupal: Beyond the Look and FeelTheming Drupal: Beyond the Look and Feel
Theming Drupal: Beyond the Look and Feel
 
Drupal Themes
Drupal ThemesDrupal Themes
Drupal Themes
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPress
 
Drupal theming
Drupal themingDrupal theming
Drupal theming
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle theme
 
DrupalEasy: Intro to Theme Development
DrupalEasy: Intro to Theme DevelopmentDrupalEasy: Intro to Theme Development
DrupalEasy: Intro to Theme Development
 
Pre process functions in template.php
Pre process functions in template.phpPre process functions in template.php
Pre process functions in template.php
 
How to make a WordPress theme
How to make a WordPress themeHow to make a WordPress theme
How to make a WordPress theme
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
 
Best practice for WordPress theme building - WordPress North East June 2021
Best practice for WordPress theme building - WordPress North East June 2021Best practice for WordPress theme building - WordPress North East June 2021
Best practice for WordPress theme building - WordPress North East June 2021
 
Hpage
HpageHpage
Hpage
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
Crash Course in Theme Surgery
Crash Course in Theme SurgeryCrash Course in Theme Surgery
Crash Course in Theme Surgery
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
 
Drupal 8 Hooks
Drupal 8 HooksDrupal 8 Hooks
Drupal 8 Hooks
 
Creating and Theming Custom Content Types
Creating and Theming Custom Content TypesCreating and Theming Custom Content Types
Creating and Theming Custom Content Types
 
Intro To jQuery In Drupal
Intro To jQuery In DrupalIntro To jQuery In Drupal
Intro To jQuery In Drupal
 

More from Peter Arato

Drupal contribution
Drupal contributionDrupal contribution
Drupal contribution
Peter Arato
 

More from Peter Arato (20)

Drupal and Neo4J
Drupal and Neo4JDrupal and Neo4J
Drupal and Neo4J
 
Stat diary
Stat diaryStat diary
Stat diary
 
Drupal contribution
Drupal contributionDrupal contribution
Drupal contribution
 
Less
LessLess
Less
 
Drupal and communication
Drupal and communicationDrupal and communication
Drupal and communication
 
Taste of flex
Taste of flexTaste of flex
Taste of flex
 
Drupal troubleshooting
Drupal troubleshootingDrupal troubleshooting
Drupal troubleshooting
 
Drupal and testing (2010 - 2011 / 2)
Drupal and testing (2010 - 2011 / 2)Drupal and testing (2010 - 2011 / 2)
Drupal and testing (2010 - 2011 / 2)
 
Drupal and contribution (2010 - 2011 / 2)
Drupal and contribution (2010 - 2011 / 2)Drupal and contribution (2010 - 2011 / 2)
Drupal and contribution (2010 - 2011 / 2)
 
Drupal Translation
Drupal TranslationDrupal Translation
Drupal Translation
 
Drupal Translation
Drupal TranslationDrupal Translation
Drupal Translation
 
Drupal Filters
Drupal FiltersDrupal Filters
Drupal Filters
 
Drupal Multisite
Drupal MultisiteDrupal Multisite
Drupal Multisite
 
I Love Techno - the site
I Love Techno - the siteI Love Techno - the site
I Love Techno - the site
 
Drupal Contributing
Drupal ContributingDrupal Contributing
Drupal Contributing
 
Drupal Contribution
Drupal ContributionDrupal Contribution
Drupal Contribution
 
How to build a Druplash site?
How to build a Druplash site?How to build a Druplash site?
How to build a Druplash site?
 
Flash And Drupal
Flash And DrupalFlash And Drupal
Flash And Drupal
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
 
Drupal & Flash
Drupal & FlashDrupal & Flash
Drupal & Flash
 

Recently uploaded

National-Learning-Camp 2024 deped....pptx
National-Learning-Camp 2024 deped....pptxNational-Learning-Camp 2024 deped....pptx
National-Learning-Camp 2024 deped....pptx
AlecAnidul
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
Jaime Brown
 
一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理
cyebo
 
Research about Venice ppt for grade 6f anas
Research about Venice ppt for grade 6f anasResearch about Venice ppt for grade 6f anas
Research about Venice ppt for grade 6f anas
anasabutalha2013
 
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
JIT KUMAR GUPTA
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
cyebo
 

Recently uploaded (20)

Heidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD PortfolioHeidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD Portfolio
 
Common Designing Mistakes and How to avoid them
Common Designing Mistakes and How to avoid themCommon Designing Mistakes and How to avoid them
Common Designing Mistakes and How to avoid them
 
FW25-26 Fashion Key Items Trend Book Peclers Paris
FW25-26 Fashion Key Items Trend Book Peclers ParisFW25-26 Fashion Key Items Trend Book Peclers Paris
FW25-26 Fashion Key Items Trend Book Peclers Paris
 
Week of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_HeadersWeek of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_Headers
 
Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..
 
National-Learning-Camp 2024 deped....pptx
National-Learning-Camp 2024 deped....pptxNational-Learning-Camp 2024 deped....pptx
National-Learning-Camp 2024 deped....pptx
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
 
一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理
 
Research about Venice ppt for grade 6f anas
Research about Venice ppt for grade 6f anasResearch about Venice ppt for grade 6f anas
Research about Venice ppt for grade 6f anas
 
Art Nouveau Movement Presentation for Art History.
Art Nouveau Movement Presentation for Art History.Art Nouveau Movement Presentation for Art History.
Art Nouveau Movement Presentation for Art History.
 
Pitch Presentation for Service Design in Technology
Pitch Presentation for Service Design in TechnologyPitch Presentation for Service Design in Technology
Pitch Presentation for Service Design in Technology
 
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
 
Recycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdfRecycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdf
 
The Design Code Google Developer Student Club.pptx
The Design Code Google Developer Student Club.pptxThe Design Code Google Developer Student Club.pptx
The Design Code Google Developer Student Club.pptx
 
Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3
 
Redefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and LocalisationRedefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and Localisation
 
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdfSpring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
 
bobbi goods amelie y ximena # Bobbie gods forever
bobbi goods amelie y ximena # Bobbie gods foreverbobbi goods amelie y ximena # Bobbie gods forever
bobbi goods amelie y ximena # Bobbie gods forever
 
Eric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-INEric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-IN
 

Drupal 7 Theme System