Drupal 7 Theme System

5,030 views
4,771 views

Published on

Brief presentation about Drupal 7's theme and template system.

Published in: Design
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,030
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
89
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Drupal 7 Theme System

  1. 1. Drupal 7 Theme System
  2. 2. Themehttp://drupal.org/project/themes
  3. 3. Theme from scratch
  4. 4. sites/default/themes/NAME NAME.info
  5. 5. name = My super themecore = 7.xengine = phptemplate
  6. 6. NAME.infostylesheets[all][] = css/style.css all, print,File screen,css/style.css projector
  7. 7. Webkit Inspector FirebugIE Developers Toolbar
  8. 8. NAME.infoscripts[] = js/actions.jsFilejs/actions.js
  9. 9. Regions
  10. 10. Name.inforegions[sidebar] = Sidebarregions[ads_mini] = Small adsregions[ads_big] = Big ads first, sidebar second, content, header, footer, highlighted, help, page_bottom, page_top
  11. 11. NAME.infosettings[main_color] = orange
  12. 12. theme-settings.php
  13. 13. theme_get_settings(VAR);
  14. 14. Templates
  15. 15. Overriding template files copy
  16. 16. Special template files
  17. 17. node--nodeid.tpl.phpnode--type.tpl.phpnode.tpl.phpblock--module--delta.tpl.phpblock--module.tpl.phpblock--region.tpl.phppage.tpl.phppage--node.tpl.phppage--node--%.tpl.phppage--node--1.tpl.phppage--node--edit.tpl.phppage--front.tpl.php http://drupal.org/node/1089656
  18. 18. Template function
  19. 19. theme(HOOK, ARGS[]); image item_list link links table username breadcrumb ...
  20. 20. Overriding template function
  21. 21. 1. NAME_HOOK()2. sites/default/themes/NAME/HOOK.tpl.php3. theme_HOOK()
  22. 22. function mytheme_table($header, $rows, $args)
  23. 23. Preprocess functions
  24. 24. TEMPLATE_preprocess(&$variables, $hook)TEMPLATE_preprocess_HOOK(&$variables)
  25. 25. Defining your own template
  26. 26. HOOK_theme()
  27. 27. Distributing content
  28. 28. Subthemehttp://drupal.org/node/225125

×