Drupal Themes
# database # passing html formatted content # preprocesses # basic layout and style # high level formatting # browser - re...
What is a theme?
What is a theme?
Where are themes located?
Garland
Bluemarine
Chameleon
Marvin
Pushbutton
 
 
 
 
Regions
a online Theme list Install Configure Custom Configure Global User options
Subthemes Inherits: <ul><li>style sheets
template files
functions and overrides defined in the parent  theme's template.php file </li></ul>Does not inherit: <ul><li>the parent th...
regions (if the parent theme has custom regions) </li></ul>
page.tpl.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtm...
myownsubtheme.info name = myownsubtheme description = longer description of your subtheme core = 6.x base theme = folderna...
a online Creating a subtheme
<ul><li>Substituting templates </li></ul>modules/system/block.tpl.php -> ..themes/xy/ <ul><li>Overriding templates </li></...
page.tpl.php: <?php if ($is_front): ?> <div id=&quot;mission&quot;> <?php print $mission; ?> </div> <?php endif; ?> Dynami...
Upcoming SlideShare
Loading in...5
×

Drupal Themes

2,387

Published on

Themes in Drupal6 - basics.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,387
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
86
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Drupal Themes

  1. 1. Drupal Themes
  2. 2. # database # passing html formatted content # preprocesses # basic layout and style # high level formatting # browser - rendering Drupal core Raw data PHPTemplate Engine Theme Files
  3. 3. What is a theme?
  4. 4. What is a theme?
  5. 5. Where are themes located?
  6. 6. Garland
  7. 7. Bluemarine
  8. 8. Chameleon
  9. 9. Marvin
  10. 10. Pushbutton
  11. 15. Regions
  12. 16. a online Theme list Install Configure Custom Configure Global User options
  13. 17. Subthemes Inherits: <ul><li>style sheets
  14. 18. template files
  15. 19. functions and overrides defined in the parent theme's template.php file </li></ul>Does not inherit: <ul><li>the parent theme's logo (logo.png)
  16. 20. regions (if the parent theme has custom regions) </li></ul>
  17. 21. page.tpl.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;<?php print $language->language ?>&quot; dir=&quot;<?php print $language->dir ?>&quot;> <head> <title><?php print $head_title ?></title> <?php print $head ?> <?php print $styles ?> <?php print $scripts ?> </head> <body> . . . <div id=&quot;head&quot; class=&quot;clearfloat&quot;> <?php if ($banner) : ?> <div id=&quot;banner-region&quot;> <?php print $banner; ?> </div> <?php endif; ?> </div> <div id=&quot;navbar&quot; class=&quot;clearfloat&quot;> <?php if (isset($primary_links)) { print arthemia_primary($primary_links); } ?> <?php if ($search_box): ?> <div id=&quot;searchform&quot;><?php print $search_box; ?></div> <?php endif; ?> </div> . . . </body> </html>
  18. 22. myownsubtheme.info name = myownsubtheme description = longer description of your subtheme core = 6.x base theme = foldername (of original theme) stylesheets[all][] = myownsubtheme.css Copy regions: regions[left] = Left sidebar regions[right] = Right sidebar regions[content] = Content regions[header] = Header regions[nav] = Navigation regions[footer] = Footer
  19. 23. a online Creating a subtheme
  20. 24. <ul><li>Substituting templates </li></ul>modules/system/block.tpl.php -> ..themes/xy/ <ul><li>Overriding templates </li></ul>- Placing function overrides in the template.php file theme.inc ← function theme_breadcrumb() template.php ← function phptemplate_breadcrumb() function xy_breadcrumb() <ul>- Overriding themable functions with dedicated template files </ul> theme_upload_attachments() -> upload_attachments.tpl.php Overriding default styling
  21. 25. page.tpl.php: <?php if ($is_front): ?> <div id=&quot;mission&quot;> <?php print $mission; ?> </div> <?php endif; ?> Dynamic theming
  22. 26. page.tpl.php: <body class=&quot;<?php print $body_classes; ?>&quot;> Dynamic theming Condition Class front page .front logged in .logged-in no sidebars .no-sidebar ... Browser: <body class=&quot;front logged-in one-sidebar sidebar-left&quot;>
  23. 27. Theme Registry 1. Administer -> Site configuration -> Performance 2. Clear cached data Theme Cache 1. Administer -> Site configuration -> Performance 2. &quot; Clear&quot; button
  24. 28. <ul><li>http://www.csszengarden.com/
  25. 29. http://themegarden.org/drupal6/
  26. 30. http://drupal.org/project/Themes
  27. 31. http://drupal.org/theme-guide/6
  28. 32. http://api.drupal.org/api/group/themeable
  29. 33. http://drupal.org/node/223430
  30. 34. http://www.advantagelabs.com/how-create-subtheme-drupal-6
  31. 35. http://www.scribd.com/doc/6177566/Drupal-6-Themes-Sample-Chapter-Dynamic-Theming </li></ul>Links
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×