Form Follows File

16
Form Follows File Introduction to painless Drupal theming Django Beatty - Adub Drupal Solutions - http://adub.com

description

Introduction to painless Drupal theming

Transcript of Form Follows File

Page 1: Form Follows File

Form Follows File

Introduction to painlessDrupal theming

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 2: Form Follows File

Top Two Drupal Theming Myths

1. Theming is difficult

2. You can't control Drupal's HTML output

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 3: Form Follows File

Two ways to customise output

• Theme functions • Template files

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 4: Form Follows File

Theme functions

• Slightly easier for developers • Better performance before Drupal 6

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 5: Form Follows File

Template files

• Allows a page element to be overridden by a file in the theme e.g. Article, Block, List, List item

 • Change output simply by creating a template file

 • Consistent approach is clearer to understand and maintain

 • No performance penalty

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 6: Form Follows File

Contributed modules

• Not all contributed modules follow this approach • But many do! 

 • For those that don't, theme functions can be mapped to

template files  

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 7: Form Follows File

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 8: Form Follows File

Getting started

• Install Devel module • Enable theme developer

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 9: Form Follows File

 

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 10: Form Follows File

Examining how an element is themed

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 11: Form Follows File

 

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 12: Form Follows File

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 13: Form Follows File

 

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 14: Form Follows File

This approach can be used throughout the site

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 15: Form Follows File

Django Beatty - Adub Drupal Solutions - http://adub.com

Page 16: Form Follows File

Resources and further reading

• Devel - http://drupal.org/project/devel • Gigulate - http://drupal.org/project/gigulate

 • Front End Drupal - http://frontenddrupal.com/ 

 

Django Beatty - Adub Drupal Solutions - http://adub.com