form follows file
DESCRIPTION
Introduction to painless Drupal themingTRANSCRIPT
![Page 1: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/1.jpg)
Form Follows File
Introduction to painlessDrupal theming
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 2: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/2.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/3.jpg)
Two ways to customise output
• Theme functions • Template files
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 4: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/4.jpg)
Theme functions
• Slightly easier for developers • Better performance before Drupal 6
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 5: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/5.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/6.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/7.jpg)
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 8: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/8.jpg)
Getting started
• Install Devel module • Enable theme developer
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 9: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/9.jpg)
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 10: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/10.jpg)
Examining how an element is themed
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 11: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/11.jpg)
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 12: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/12.jpg)
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 13: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/13.jpg)
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 14: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/14.jpg)
This approach can be used throughout the site
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 15: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/15.jpg)
Django Beatty - Adub Drupal Solutions - http://adub.com
![Page 16: Form Follows File](https://reader031.vdocument.in/reader031/viewer/2022013108/553b3b99550346b94f8b46d4/html5/thumbnails/16.jpg)
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