Top Banner
Get Ready ... To prepare for this seminar you should download a copy of the following themes: http://drupal.org/project/ninesixty http://drupal.org/project/domicile If you need to leave: This session is recorded. If the recording fails, this is a similar presentation to the one I gave at DrupalCon London. The information is available in: Drupal User's Guide or workbooks at Designtotheme.com. Slides are available from: slideshare.net/emmajane
57

PSD to Theme - Acquia Webinar

Jan 27, 2015

Download

Technology

You've just been handed a gorgeous, static Photoshop file. By tomorrow it needs to be a flexible, extensible, and compatible Drupal theme for some Web site you've never seen. Oh and they said something about it needing to be responsive to 508 or something like that? *gulp* No worries! In this one-hour webinar, Drupal rock star Emma Jane Hogbin, will give you a sneak peek inside her brand new book Drupal: A User's Guide and show you how to transform a Photoshop file into a real live theme. As part of this webinar you will receive all of the code for the theme we build so you can watching, listening and learning how to quickly build themes for Drupal 7.

We'll cover:

Rapid prototyping with Minimum Viable Themes
Choosing the best base theme for your current project--no, one size doesn't fit all--especially if the design was meant to be responsive
How to save time with image extraction techniques
Smoothing out the transition from design to theme with powerful helper modules
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PSD to Theme - Acquia Webinar

Get Ready ...

To prepare for this seminar you should download a copy of the following themes:● http://drupal.org/project/ninesixty● http://drupal.org/project/domicile

If you need to leave:● This session is recorded. If the recording fails, this is a similar

presentation to the one I gave at DrupalCon London.● The information is available in: Drupal User's Guide or workbooks

at Designtotheme.com.● Slides are available from: slideshare.net/emmajane

Page 2: PSD to Theme - Acquia Webinar

Drupal Trainer

www.sitebuildingextravaganza.com

Page 3: PSD to Theme - Acquia Webinar

Workbook Author

www.designtotheme.com

Discount code available at the end of the webinar.

Page 4: PSD to Theme - Acquia Webinar

Book (Co)Author

Page 5: PSD to Theme - Acquia Webinar

Agenda

Theme Building● Theming philosophy● Process● Case study: Domicile

35 minutes

Summary● Questions/Answers● Discount Coupons

20 minutes

Page 6: PSD to Theme - Acquia Webinar

Theming Philosophy

Page 7: PSD to Theme - Acquia Webinar

Lazy Front End Developer

Page 8: PSD to Theme - Acquia Webinar

Working With OthersProduces More Honey

Page 9: PSD to Theme - Acquia Webinar

node.tpl.php

page.tpl.php

field.tpl.php

jplayer.tpl.php

Theming by tpl.php Files

Wastes Your Time

Page 10: PSD to Theme - Acquia Webinar

Minimum Viable Theme

UX

UX

UX

UX

Take Only Pictures, Leave Only Footprints

Theme Only What You Need To

Page 11: PSD to Theme - Acquia Webinar

Budget-Appropriate Web Design● Know your Drupal toolkit. Know your budget.● Focus on the biggest elements first.● Work closely with your designer and your client to

make sure you get the important things right.● Theme with the markup you have, not the markup

you'd like to have.● Pixel perfect design is for print. Get over it.

Page 12: PSD to Theme - Acquia Webinar

Accessible Web Design

“Accessible web design refers to the philosophy and practice of designing web pages so that they can be navigated and read by everyone, regardless of location, experience, or the type of computer technology used.” Australian Human Rights Commission

● Know your guidelines (508 or WAI).● Use a checklist.● Use an automated testing suite.● Test with users.

http://www.designtotheme.com/tutorials/automated-accessibility-testing

Page 13: PSD to Theme - Acquia Webinar

Responsive Web Design

“Any approach that delivers elegant visual experiences regardless of the size of the user’s display and the limitations or capabilities of the device” zeldman.

● Read: http://tinyurl.com/responsive-article

● Buy (and read): http://tinyurl.com/responsive-book

● Watch: http://tinyurl.com/pathtomobile

● Use: http://drupal.org/project/omega

(Eventually “all” base themes will be responsive.)

Page 14: PSD to Theme - Acquia Webinar

Theming Goals● Budget-appropriate.● Accessible.● Responsive.

Page 15: PSD to Theme - Acquia Webinar

Process

Page 16: PSD to Theme - Acquia Webinar

Steps to Making a Theme

1. Communicate with your whole team.

2. Plan your data structure.

3.Use wire frames to prove what you're saying about how the site ought to be built.

4.Build the site (ignore the theme).

5.Convert your wire frame to its grid layout.

6.Build out the HTML fragments in the relevant tpl.php files. Substitute CSS effects for PSD effects where possible.

7. Apply your theme to the site.

8.Refine as necessary based on the UX.

Page 17: PSD to Theme - Acquia Webinar

Data Model

http://www.flickr.com/photos/alan-dean/3513723498

Page 18: PSD to Theme - Acquia Webinar

Wire Frames

Page 19: PSD to Theme - Acquia Webinar
Page 20: PSD to Theme - Acquia Webinar
Page 21: PSD to Theme - Acquia Webinar

Begin Site Building

(This may affect site design decisions based on the theming goals of budget-appropriate, accessible and responsive.)

Page 22: PSD to Theme - Acquia Webinar

Grid Framework

http://960.gs/

Page 23: PSD to Theme - Acquia Webinar

CSS (Grid) Framework

Page 24: PSD to Theme - Acquia Webinar

Base Theme

● drupal.org/project/ninesixty● drupal.org/project/fusion● drupal.org/project/zen

Page 25: PSD to Theme - Acquia Webinar

To Build a Successful Theme

You must:● Know your data model.● Create wire frames describing page elements.● Identify the modules, templates and configuration

responsible for every element described in your wire frames.

● Use a grid framework in both your design files and Drupal templates.

● Use a base theme that meets your web design goals.

Page 26: PSD to Theme - Acquia Webinar

Case StudyBuild me a theme!

Page 27: PSD to Theme - Acquia Webinar

Steps to MVT

1. Prepare design.

2. Create theme shell (text files for Drupal).

3.Create regions.

4.Extract and embed images.

5.Launch MVT.

Page 28: PSD to Theme - Acquia Webinar

Domicile● Designed by Betty

Biesenthal.● Themed by Emma

Jane Hogbin (and the base theme NineSixty).

● Code available from http://drupal.org/project/domicile

Page 29: PSD to Theme - Acquia Webinar

Domicile Theme

Page 30: PSD to Theme - Acquia Webinar

Grid Overlay

Page 31: PSD to Theme - Acquia Webinar

Wire Frame for NineSixty Sub-Theme

Page 32: PSD to Theme - Acquia Webinar

Create a Theme Shell

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

Also: sites/all/themes/base_theme

Page 33: PSD to Theme - Acquia Webinar

Take a peek

1. Download the theme: http://drupal.org/project/domicile

2. Unzip the package.

3.Look at the files inside.

Page 34: PSD to Theme - Acquia Webinar

domicile.infoname = 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.

; Regions

; Features

Page 35: PSD to Theme - Acquia Webinar

Build page.tpl.php from NineSixty

Page 36: PSD to Theme - Acquia Webinar

Identify These Shapes in Domicile

Page 37: PSD to Theme - Acquia Webinar

Define Regions and Blocks

Page 38: PSD to Theme - Acquia Webinar

Extract Images from the PSD

Page 39: PSD to Theme - Acquia Webinar
Page 40: PSD to Theme - Acquia Webinar
Page 41: PSD to Theme - Acquia Webinar

Hard Code Fixed Images

Page 42: PSD to Theme - Acquia Webinar

Minimum Viable Theme

Page 43: PSD to Theme - Acquia Webinar

Steps to MVT Summary

1. Prepare design.

2. Create theme shell (text files for Drupal).

3.Create regions.

4.Extract and embed images.

5.Launch MVT.

Page 44: PSD to Theme - Acquia Webinar

What's Wrong?

Pink sherbert photography http://www.flickr.com/photos/pinksherbet/3372060864/

Page 45: PSD to Theme - Acquia Webinar

Theme by UX

Locate “problem” areas and fix with:● The administrative interface.● CSS enhancements.

And if you need more control add:● Helper modules.● Theme template files.● Theme functions.

Page 46: PSD to Theme - Acquia Webinar

Administrative Interface

Page 47: PSD to Theme - Acquia Webinar

CSS Enhancements

Relevant HTML source

Page element CSS styles

Page 48: PSD to Theme - Acquia Webinar

Apply Generic Styles

Page 49: PSD to Theme - Acquia Webinar

Apply Build-Specific Styles

Page 50: PSD to Theme - Acquia Webinar

Site Building/Theming Helpers

Themer Tools● Devel● Theme Developer● Firebug for Drupal

Layout● Panels● Context● Display Suite

Site Building● Views● Nodes in Block● Menu Block● Entity View Mode● Media● jPlayer● etc

Page 51: PSD to Theme - Acquia Webinar

tpl.php● page.tpl.php● node.tpl.php● page-front.tpl.php● block.tpl.php● Error pages: 403, 404, 500

Page 52: PSD to Theme - Acquia Webinar

Theme Functions

Finally...and only if you really must:● Preprocess functions.● Form altering functions.● Functionality-based PHP snippets.● (etc)

Page 53: PSD to Theme - Acquia Webinar

Domicile: the theme

Page 54: PSD to Theme - Acquia Webinar

Theme Building Summary

Minimum Viable Theme1. Prepare design.

2. Create required theme files.

3. Create regions in page.tpl.php.

4. Extract and embed images.

5. Launch MVT.

Theme by UX6. Administrative interface

7. CSS enhancements

8. Module helpers

9. tpl.php files

10.Theme functions

Page 55: PSD to Theme - Acquia Webinar

PSD to Theme Summary● Plan your theme from the data model out, not the template files in.

● Use relevant Drupal modules to break up content and display it in relevant locations.

● Extract only the images and colours you need from your PSD file.

● Using your grid, rebuild your design as a minimum viable theme in the fewest possible tpl.php files.

● Fix any outstanding problems according to the expected user experience with the site.

● Test your site using automated testing suites for cross-browser and accessibility issues. Then test again using as much real content and as many real people as you can afford.

● Cross your fingers and launch.

Page 56: PSD to Theme - Acquia Webinar

www.informit.comSAVE 35% on Drupal User's Guide.Discount Code: DRUPALUSER

www.designtotheme.comSave 35% on all titles.

Discount Code: ACQUIA-P2T

1. PSD to Drupal Theme2. SBE Guide: Micro Site

www.drupalwatchdog.com/readIssue 1: Free PSD to Theme article.

Discounts on Practical Drupal Guides

Page 57: PSD to Theme - Acquia Webinar

Stay in Touch● @emmajanedotnet● [email protected]● www.designtotheme.com