SlideShare a Scribd company logo
Creating an Initial
Custom Theme in
     Drupal
     by Troy Shields
      www.troyshields.com




                            1
Assumptions


• You understand how to:
 • Set up a Drupal site
 • Write HTML/CSS



                           2
The Situation
           What I Wish I Knew


• You’re a “Themer”
• You’re working with a team of    Explain my experience
                                   and “what I wish I
                                   knew”
  developers

• You’re working in tandem
• You need to get base styles & your
  regions in place for your developers


                                                           3
Understanding the Files


• sites/all/themes/yourthemename
 • .info file
 • logo.png, screenshot.png
 • stylesheets & tpls         Go over what’s in INFO
                              file:
                                   Name
                                   Regions
                                   CSS




                                                       4
Creating the Template
                                    Bad HTML and CSS are not
                                    Drupal’s fault. If it doesn’t
                                    work outside of Drupal, it
                                    won’t work inside of
                                    Drupal.

• Create a static template & test in
  browsers you support
                                    page-front/homepage is
                                    last because it’s a

• page.tpl.php should be the most   conglomeration of the
                                    rest of the site. Use as
                                    few page tpls as possible

  common page
                                    if nothing is in the

• Simple “if” statements for sidebars
                                    sidebar, it won’t show up.
                                    use body class to style
                                    columns appropriately



• Site Building: build what you know

                                                                    5
A Theory of CSS

• Understand Floating & Positioning. Holy Grail
• Absolutely position elements in headers with
  static heights. There are no mysteries here

• Columns need floats and widths, but rarely
  elements inside of them

• Use negative margins sparingly. This is often
  used as a band-aid on a gunshot wound



                                                  6
Wrap Up
                                     think: generic enough to
                                     contribute or use for
                                     another site.


• Build stuff you know. Columns,
  header, footer.
• Stuff you don’t know. Theming that
  relies on specific id’s and classes
  output by Drupal modules.
                                   This is stuff with id’s and
                                   classes you don’t know
                                   because they haven’t been
                                   built.




                                                                 7
The End.
Thanks.



           8

More Related Content

What's hot

Designing hacks
Designing hacksDesigning hacks
Designing hacks
jbcima
 

What's hot (15)

Role of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upRole of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-up
 
The Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upThe Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-up
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
 
Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019
 
Designing hacks
Designing hacksDesigning hacks
Designing hacks
 
Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7
 
Fundamentals of blogging
Fundamentals of bloggingFundamentals of blogging
Fundamentals of blogging
 
Blogging 101
Blogging 101Blogging 101
Blogging 101
 
SEO Horror Stories
SEO Horror StoriesSEO Horror Stories
SEO Horror Stories
 
Best Practices for Business Blogging
Best Practices for Business BloggingBest Practices for Business Blogging
Best Practices for Business Blogging
 
Coding For Fun And Profit
Coding For Fun And ProfitCoding For Fun And Profit
Coding For Fun And Profit
 
Tech Fair 2010
Tech Fair 2010Tech Fair 2010
Tech Fair 2010
 
Web Accessibility Gone Wild
Web Accessibility Gone WildWeb Accessibility Gone Wild
Web Accessibility Gone Wild
 
Wrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themesWrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themes
 
Wrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themesWrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themes
 

Viewers also liked (6)

ENoLL FAO Workshop Darko Ferčej
ENoLL FAO Workshop Darko FerčejENoLL FAO Workshop Darko Ferčej
ENoLL FAO Workshop Darko Ferčej
 
Jjjjj
JjjjjJjjjj
Jjjjj
 
Jatin
JatinJatin
Jatin
 
In ibama n° 31 2009 ctf nova
In ibama n° 31 2009 ctf novaIn ibama n° 31 2009 ctf nova
In ibama n° 31 2009 ctf nova
 
Acta de creación de AveAgua
Acta de creación de AveAgua Acta de creación de AveAgua
Acta de creación de AveAgua
 
Storyboard
StoryboardStoryboard
Storyboard
 

Similar to Building an Initial Custom Theme

Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
Mediacurrent
 
Drupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better ThemesDrupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better Themes
nyccamp
 
Using Open Atrium in Your Organization
Using Open Atrium in Your OrganizationUsing Open Atrium in Your Organization
Using Open Atrium in Your Organization
Phase2
 
Tenthingsivelearnedaboutdrupal 120130164528-phpapp02
Tenthingsivelearnedaboutdrupal 120130164528-phpapp02Tenthingsivelearnedaboutdrupal 120130164528-phpapp02
Tenthingsivelearnedaboutdrupal 120130164528-phpapp02
Luisa Fernanda
 
Drupal theming 101
Drupal theming 101Drupal theming 101
Drupal theming 101
Exove
 
Forensic Theming - DrupalCon London
Forensic Theming - DrupalCon LondonForensic Theming - DrupalCon London
Forensic Theming - DrupalCon London
Emma Jane Hogbin Westby
 

Similar to Building an Initial Custom Theme (20)

Evaluating Base Themes
Evaluating Base ThemesEvaluating Base Themes
Evaluating Base Themes
 
Nanocon Taiwan
Nanocon TaiwanNanocon Taiwan
Nanocon Taiwan
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
 
New Adventures in Drupal Theming
New Adventures in Drupal ThemingNew Adventures in Drupal Theming
New Adventures in Drupal Theming
 
Forensic Theming for Drupal
Forensic Theming for DrupalForensic Theming for Drupal
Forensic Theming for Drupal
 
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)
 
Drupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better ThemesDrupal Aware Design: Good Techniques for Better Themes
Drupal Aware Design: Good Techniques for Better Themes
 
Drupal 6 Theming
Drupal 6 ThemingDrupal 6 Theming
Drupal 6 Theming
 
Using Open Atrium in Your Organization
Using Open Atrium in Your OrganizationUsing Open Atrium in Your Organization
Using Open Atrium in Your Organization
 
Ten things i've learned about drupal
Ten things i've learned about drupalTen things i've learned about drupal
Ten things i've learned about drupal
 
Tenthingsivelearnedaboutdrupal 120130164528-phpapp02
Tenthingsivelearnedaboutdrupal 120130164528-phpapp02Tenthingsivelearnedaboutdrupal 120130164528-phpapp02
Tenthingsivelearnedaboutdrupal 120130164528-phpapp02
 
Top 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectTop 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal project
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworks
 
Drupal theming 101
Drupal theming 101Drupal theming 101
Drupal theming 101
 
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
 
Forensic Theming - DrupalCon London
Forensic Theming - DrupalCon LondonForensic Theming - DrupalCon London
Forensic Theming - DrupalCon London
 
Drupal 7: Theming with Omega
Drupal 7: Theming with OmegaDrupal 7: Theming with Omega
Drupal 7: Theming with Omega
 
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
 
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 ...
 
Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014
 

Recently uploaded

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 

Building an Initial Custom Theme

  • 1. Creating an Initial Custom Theme in Drupal by Troy Shields www.troyshields.com 1
  • 2. Assumptions • You understand how to: • Set up a Drupal site • Write HTML/CSS 2
  • 3. The Situation What I Wish I Knew • You’re a “Themer” • You’re working with a team of Explain my experience and “what I wish I knew” developers • You’re working in tandem • You need to get base styles & your regions in place for your developers 3
  • 4. Understanding the Files • sites/all/themes/yourthemename • .info file • logo.png, screenshot.png • stylesheets & tpls Go over what’s in INFO file: Name Regions CSS 4
  • 5. Creating the Template Bad HTML and CSS are not Drupal’s fault. If it doesn’t work outside of Drupal, it won’t work inside of Drupal. • Create a static template & test in browsers you support page-front/homepage is last because it’s a • page.tpl.php should be the most conglomeration of the rest of the site. Use as few page tpls as possible common page if nothing is in the • Simple “if” statements for sidebars sidebar, it won’t show up. use body class to style columns appropriately • Site Building: build what you know 5
  • 6. A Theory of CSS • Understand Floating & Positioning. Holy Grail • Absolutely position elements in headers with static heights. There are no mysteries here • Columns need floats and widths, but rarely elements inside of them • Use negative margins sparingly. This is often used as a band-aid on a gunshot wound 6
  • 7. Wrap Up think: generic enough to contribute or use for another site. • Build stuff you know. Columns, header, footer. • Stuff you don’t know. Theming that relies on specific id’s and classes output by Drupal modules. This is stuff with id’s and classes you don’t know because they haven’t been built. 7