48
Forensic Theming Emma Jane Hogbin

Forensic Theming for Drupal

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Forensic Theming for Drupal

Forensic ThemingEmma Jane Hogbin

Page 2: Forensic Theming for Drupal

Book (Co)Author

Page 3: Forensic Theming for Drupal

Trainer: Site Building Extravaganza

http://farm4.static.flickr.com/3567/3392276341_8712643bfb.jpg

Page 4: Forensic Theming for Drupal

Workbook Author: Design to Theme

See also: the inside spread of your Drupal Watchdog, that really awesome magazine that's in your loot bag.

Page 5: Forensic Theming for Drupal

Knitter of The Socks

Pattern at: www.emmajane.net/craft/drupal

http://www.flickr.com/photos/mortendk/1439332466/

Page 6: Forensic Theming for Drupal

www.emmajane.net/craft/drupal

Page 7: Forensic Theming for Drupal

Happy 100Happy 100thth

International Women's DayInternational Women's Day

Page 8: Forensic Theming for Drupal

The Making of a Theme

Mommy, where do themes come from?● Modules → ● Templates → ● Base theme →● Your theme → ● Rendered page

Page 9: Forensic Theming for Drupal

Steps to Making a Theme

● Communicate with your whole team.● Use wire frames to prove what you're saying about

how the site ought to be built.● Build the site without a theme.● Convert your wire frame to a grid layout.● Build out the HTML fragments in the relevant

tpl.php files.● Apply your theme to the site.● Refine as necessary based on the UX.

Page 10: Forensic Theming for Drupal

Key Tools

Page 11: Forensic Theming for Drupal
Page 12: Forensic Theming for Drupal

Wire Frames

www.balsamiq.com

Page 13: Forensic Theming for Drupal

CSS Grid Framework

http://960.gs/

Page 14: Forensic Theming for Drupal

CSS Grid Framework

Page 15: Forensic Theming for Drupal

Base Theme

● drupal.org/project/ninesixty● drupal.org/project/fusion● http://drupal.org/project/zen_ninesixty

Page 16: Forensic Theming for Drupal

Text EditorText EditorUse something better than a punch in the face.

Page 17: Forensic Theming for Drupal

Names of Drupal Variables

Also go to: http://api.drupal.org

Page 18: Forensic Theming for Drupal

But how do I theme that thing?

Page 19: Forensic Theming for Drupal

Forensic Theming

● Definition: the art of investigating a Drupal page to find out how that thing got there.

● Toolkit:● Firebug● Sweaver● Devel themer

● Requirements: Plan and Build your site before you theme.

Page 20: Forensic Theming for Drupal

Step Away from the Code

● Most common problems are so common they can be solved with settings in the administrative interface.

● Get to know Drupal really well and can do less work to make your site look right.

● Use helper modules to avoid writing new code.

Page 21: Forensic Theming for Drupal

The Clues are in the Code

● Look at the class names to find out what module made that.

● Use the body classes to make page-specific selectors.

● Before you make another theme tpl.php file make sure you really need to.

Page 22: Forensic Theming for Drupal
Page 23: Forensic Theming for Drupal

Firebug

● Inspect element.● Edit CSS properties.● Edit CSS files.● Cannot publish changes.● www.getfirebug.com

Page 24: Forensic Theming for Drupal

Less Yucky Markup

● European vs American theming● Inheritance: start with a better base.● Base theme: mothership● Modules: Semantic Views● D6 Modules: Semantic CCK

Page 25: Forensic Theming for Drupal
Page 26: Forensic Theming for Drupal

Sweaver

● Pointy-clicky-non-scary CSS class selector.● Can make minor changes to CSS for a set of styles

and save to the server.● drupal.org/project/sweaver

Page 27: Forensic Theming for Drupal
Page 28: Forensic Theming for Drupal

Devel / Themer

● The Cadillac of theming tools.● Tells you which tpl.php or theme function is

responsible for that thing displaying over there.

Page 29: Forensic Theming for Drupal

Build me a theme!

Page 30: Forensic Theming for Drupal
Page 31: Forensic Theming for Drupal
Page 32: Forensic Theming for Drupal
Page 33: Forensic Theming for Drupal

Theme Folder

sites/example.com/themes/theme_name   theme_name.info   page.tpl.php

Also: sites/all/themes/base_theme

Page 34: Forensic Theming for Drupal

theme_name.info (1 of 2)name = D7SBE - Domicile

description = A three-column design by Design House (www.design-house.ca) and themed by Design to Theme.

screenshot = screenshot.png

core = 7.x

engine = phptemplate

base theme = ninesixty

; Stylesheets.

stylesheets[all][] = styles.css

; To show the 960.gs grid and debug your theme's layout, delete this section.

; You will be able to remove this when http://drupal.org/node/1032486 is rolled out

stylesheets[all][] = debug.css

Page 35: Forensic Theming for Drupal

theme_name.info (2 of 2)

; Regions

regions[nav_left] = Navigation (left)

regions[feature_middle]= Feature column (middle)

regions[content] = Content column (right)

regions[copyright_footer] = Copyright notice (footer)

; Features

features[] = logo

features[] = name

features[] = favicon

Page 36: Forensic Theming for Drupal

page.tpl.php

Page 37: Forensic Theming for Drupal
Page 38: Forensic Theming for Drupal
Page 39: Forensic Theming for Drupal
Page 40: Forensic Theming for Drupal
Page 41: Forensic Theming for Drupal
Page 42: Forensic Theming for Drupal

Hard Code Relevant Images

Page 43: Forensic Theming for Drupal

Minimum Viable Theme

Page 44: Forensic Theming for Drupal

+ forensic theming

Page 45: Forensic Theming for Drupal

styles.css

Page 46: Forensic Theming for Drupal

Domicile: the theme

Page 47: Forensic Theming for Drupal

Domicile

● Designed by Betty Biesenthal.● Themed by Emma Jane Hogbin.● Will be available from

http://drupal.org/project/domicile

Page 48: Forensic Theming for Drupal

What did you think?Locate this session on the DCC

website:http://chicago2011.drupal.org/sessions

Click the “Take the Survey” link.

Thanks!