SlideShare uma empresa Scribd logo
1 de 32
Maak een Drupal Theme Hans Rossel -  www.koba.be
Theme instellingen
Theme instellingen ,[object Object]
Beheertemplate: admin/settings/admin
Eigen template: user/uid/edit (toegangsrecht 'selecteer een andere template' in admin/user/permissions)‏
Blokken per theme: admin/build/block
Extra variabelen: admin/settings/site-information
Garland ,[object Object]
Fluid dus ok voor backend/admin theme,  maar nu ook  http://drupal.org/project/admin  en   http://drupal.org/project/rootcandy
Niet zo goed als frontend
Niet zo goed als starttheme
 
Theme anatomie
Basisbestanden: phptemplate ,[object Object]
screenshot.png
Css: Gewoonlijk: style, print, ie6
Template files ,[object Object]
31 template bestanden in core in D6  (http://drupal.org/node/190815#default-templates)‏ ,[object Object]
Methode 1: Subtheme van Prefab Theme Links op drupal.be/nl http://drupal.be/node/1809   Gratis http://drupal.org/project/Themes http://themegarden.org/drupal6/ Betalend http://www.topnotchthemes.com/browse   http://www.templatemonster.com/drupal-themes.php Aanbevolen methode :  Subtheme vb Minelli
Methode 2 Subtheme van Starter Theme ,[object Object]
http://drupal.org/project/genesis
http://drupal.org/project/framework
http://drupal.org/project/hunchbaque CSS Frameworks ,[object Object]
http://drupal.org/project/ninesixty
Mooie code, Lelijk Theme
Methode 3: Vanaf eigen html/css prototype http://drupal.org/theme-guide http://www.oswd.org/designs/favorites/ http://www.styleshout.com   Zenlike theme: http://www.oswd.org/design/preview/id/3559
Stap 0: Voorzorgen ,[object Object]
Theme registry wordt gecached! ,[object Object]
Automatisch: Voeg drupal_rebuild_theme_registry(); toe onderaan template.php (Let op: achteraf terug weghalen!)
STAP 1: Theme map ,[object Object]
Plaats je index.html en style.css die je ontworpen hebt erin
Hernoem index.html naar page.tpl.php

Mais conteúdo relacionado

Mais procurados

Amp html blogger templates
Amp html blogger templatesAmp html blogger templates
Amp html blogger templatesRyan steve
 
CSS Components
CSS ComponentsCSS Components
CSS Components拓樹 谷
 
Joomla Day Austin Part 3
Joomla Day Austin Part 3Joomla Day Austin Part 3
Joomla Day Austin Part 3Kyle Ledbetter
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2raj lex
 
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説Takashi Uemura
 
Od zera do motywów kodera
Od zera  do motywów koderaOd zera  do motywów kodera
Od zera do motywów koderaDawid Szwed
 
Drupal Training - Introductie
Drupal Training - IntroductieDrupal Training - Introductie
Drupal Training - IntroductieTauros Marketing
 
Blogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelograndeBlogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelograndeangelogrande782
 

Mais procurados (15)

Template ku
Template kuTemplate ku
Template ku
 
Amp html blogger templates
Amp html blogger templatesAmp html blogger templates
Amp html blogger templates
 
DestakNews
DestakNewsDestakNews
DestakNews
 
Modelo Php
Modelo PhpModelo Php
Modelo Php
 
CSS Components
CSS ComponentsCSS Components
CSS Components
 
JSztuczki
JSztuczkiJSztuczki
JSztuczki
 
Joomla Day Austin Part 3
Joomla Day Austin Part 3Joomla Day Austin Part 3
Joomla Day Austin Part 3
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2
 
Jsoon
JsoonJsoon
Jsoon
 
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
 
Od zera do motywów kodera
Od zera  do motywów koderaOd zera  do motywów kodera
Od zera do motywów kodera
 
Spring Capitulo 04
Spring Capitulo 04Spring Capitulo 04
Spring Capitulo 04
 
Drupal Training - Introductie
Drupal Training - IntroductieDrupal Training - Introductie
Drupal Training - Introductie
 
Blospot
BlospotBlospot
Blospot
 
Blogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelograndeBlogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelogrande
 

Destaque

D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - LondonMarek Sotak
 
Putting Phing to Work for You
Putting Phing to Work for YouPutting Phing to Work for You
Putting Phing to Work for Youhozn
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Laura Scott
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
Bayesian statistics using r intro
Bayesian statistics using r   introBayesian statistics using r   intro
Bayesian statistics using r introBayesLaplace1
 
Contoh karangan-berpandu-1
Contoh karangan-berpandu-1Contoh karangan-berpandu-1
Contoh karangan-berpandu-1Loh Yan
 
Contoh karangan
Contoh karanganContoh karangan
Contoh karanganNur Afifa
 

Destaque (8)

Theme Gurus
Theme GurusTheme Gurus
Theme Gurus
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
Putting Phing to Work for You
Putting Phing to Work for YouPutting Phing to Work for You
Putting Phing to Work for You
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Bayesian statistics using r intro
Bayesian statistics using r   introBayesian statistics using r   intro
Bayesian statistics using r intro
 
Contoh karangan-berpandu-1
Contoh karangan-berpandu-1Contoh karangan-berpandu-1
Contoh karangan-berpandu-1
 
Contoh karangan
Contoh karanganContoh karangan
Contoh karangan
 

Mais de Hans Rossel

Javascript Intro
Javascript IntroJavascript Intro
Javascript IntroHans Rossel
 
Drupal opleiding
Drupal opleidingDrupal opleiding
Drupal opleidingHans Rossel
 
Drupal koba-nov2013
Drupal koba-nov2013Drupal koba-nov2013
Drupal koba-nov2013Hans Rossel
 
Drupal7 Development
Drupal7 DevelopmentDrupal7 Development
Drupal7 DevelopmentHans Rossel
 
Html5 jeugdwerknet
Html5 jeugdwerknetHtml5 jeugdwerknet
Html5 jeugdwerknetHans Rossel
 
Drupal Views Cck Hans Rossel
Drupal Views Cck Hans RosselDrupal Views Cck Hans Rossel
Drupal Views Cck Hans RosselHans Rossel
 
Drupal 7 Theming
Drupal 7 ThemingDrupal 7 Theming
Drupal 7 ThemingHans Rossel
 
Drupal intro 2010
Drupal intro 2010Drupal intro 2010
Drupal intro 2010Hans Rossel
 
Drupal Cursus Hans Rossel
Drupal Cursus Hans RosselDrupal Cursus Hans Rossel
Drupal Cursus Hans RosselHans Rossel
 
Powerpoint Htmlcss
Powerpoint HtmlcssPowerpoint Htmlcss
Powerpoint HtmlcssHans Rossel
 

Mais de Hans Rossel (14)

Drupal8
Drupal8Drupal8
Drupal8
 
Html css
Html cssHtml css
Html css
 
Javascript Intro
Javascript IntroJavascript Intro
Javascript Intro
 
Drupal opleiding
Drupal opleidingDrupal opleiding
Drupal opleiding
 
Drupal koba-nov2013
Drupal koba-nov2013Drupal koba-nov2013
Drupal koba-nov2013
 
Drupal7 Development
Drupal7 DevelopmentDrupal7 Development
Drupal7 Development
 
Drupal7 Theming
Drupal7 ThemingDrupal7 Theming
Drupal7 Theming
 
Html5 jeugdwerknet
Html5 jeugdwerknetHtml5 jeugdwerknet
Html5 jeugdwerknet
 
Drupalgardens
DrupalgardensDrupalgardens
Drupalgardens
 
Drupal Views Cck Hans Rossel
Drupal Views Cck Hans RosselDrupal Views Cck Hans Rossel
Drupal Views Cck Hans Rossel
 
Drupal 7 Theming
Drupal 7 ThemingDrupal 7 Theming
Drupal 7 Theming
 
Drupal intro 2010
Drupal intro 2010Drupal intro 2010
Drupal intro 2010
 
Drupal Cursus Hans Rossel
Drupal Cursus Hans RosselDrupal Cursus Hans Rossel
Drupal Cursus Hans Rossel
 
Powerpoint Htmlcss
Powerpoint HtmlcssPowerpoint Htmlcss
Powerpoint Htmlcss
 

Drupal Theming Hans Rossel

  • 1. Maak een Drupal Theme Hans Rossel - www.koba.be
  • 3.
  • 5. Eigen template: user/uid/edit (toegangsrecht 'selecteer een andere template' in admin/user/permissions)‏
  • 6. Blokken per theme: admin/build/block
  • 8.
  • 9. Fluid dus ok voor backend/admin theme, maar nu ook http://drupal.org/project/admin en http://drupal.org/project/rootcandy
  • 10. Niet zo goed als frontend
  • 11. Niet zo goed als starttheme
  • 12.  
  • 14.
  • 17.
  • 18.
  • 19. Methode 1: Subtheme van Prefab Theme Links op drupal.be/nl http://drupal.be/node/1809 Gratis http://drupal.org/project/Themes http://themegarden.org/drupal6/ Betalend http://www.topnotchthemes.com/browse http://www.templatemonster.com/drupal-themes.php Aanbevolen methode : Subtheme vb Minelli
  • 20.
  • 23.
  • 26. Methode 3: Vanaf eigen html/css prototype http://drupal.org/theme-guide http://www.oswd.org/designs/favorites/ http://www.styleshout.com Zenlike theme: http://www.oswd.org/design/preview/id/3559
  • 27.
  • 28.
  • 29. Automatisch: Voeg drupal_rebuild_theme_registry(); toe onderaan template.php (Let op: achteraf terug weghalen!)
  • 30.
  • 31. Plaats je index.html en style.css die je ontworpen hebt erin
  • 32. Hernoem index.html naar page.tpl.php
  • 33. STAP 2: .info file definitie theme Maak abc.info file met inhoud (copieer garland.info, hernoem en pas aan) Meer info: .info handbook: http://drupal.org/node/171205 ; $Id$ name = ABC Theme description = Heel mooi theme version = VERSION core = 6.x engine = phptemplate stylesheets[all][] = style.css stylesheets[print][] = print.css
  • 34. STAP 3: css en js In .info file: stylesheets[all][] = style.css stylesheets[print][] = print.css scripts[] = myscript.js In page.tpl.php: <?php print $styles; ?> <?php print $scripts; ?>
  • 35.
  • 36. Constructie invoegen variabelen (Theme coding conventions: http://drupal.org/node/1965 )‏ <?php if ($tabs): ?> <div class=&quot;tabs&quot;> <?php print $tabs; ?> </div> <?php endif; ?>
  • 37. Doctype en head copiëren <!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; lang=&quot;<?php print $language->language ?>&quot; dir=&quot;<?php print $language->dir ?>&quot;> <head> <?php print $head ?> <title><?php print $head_title ?></title> <?php print $styles ?> <?php print $scripts ?> </head> <body>
  • 38. Menus copiëren <?php if (isset($primary_links)) : ?> <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?> <?php endif; ?> <?php if (isset($secondary_links)) : ?> <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?> <?php endif; ?>
  • 39. Zoekbox copiëren <?php if ($search_box): ?> <div class=&quot;block block-theme&quot;> <?php print $search_box ?> </div> <?php endif; ?>
  • 40. Hoofdinhoud copiëren Via Firebug: kijken in theme: #primarycontent: statische inhoud vervangen door Drupal variabelen: <?php print $breadcrumb; ?> <?php if ($mission): print '<div id=&quot;mission&quot;>'. $mission .'</div>'; endif; ?> <?php if ($tabs): print '<div id=&quot;tabs-wrapper&quot; class=&quot;clear-block&quot;>'; endif; ?> <?php if ($title): print '<h2'. ($tabs ? ' class=&quot;with-tabs&quot;' : '') .'>'. $title .'</h2>'; endif; ?> <?php if ($tabs): print '<ul class=&quot;tabs primary&quot;>'. $tabs .'</ul></div>'; endif; ?> <?php if ($tabs2): print '<ul class=&quot;tabs secondary&quot;>'. $tabs2 .'</ul>'; endif; ?> <?php if ($show_messages && $messages): print $messages; endif; ?> <?php print $help; ?> <div class=&quot;clear-block&quot;> <?php print $content ?> </div> <?php print $feed_icons ?>
  • 41. Rechterkolom copiëren <?php if ($right): ?> <div id=&quot;sidebar-right&quot; class=&quot;sidebar&quot;> <?php if (!$left && $search_box): ?><div class=&quot;block block-theme&quot;><?php print $search_box ?></div><?php endif; ?> <?php print $right ?> </div> <?php endif; ?> Zorg dat je rechterkolom blokken hebt.
  • 42. Footer copiëren <?php print $footer_message . $footer ?> <?php print $closure ?> voor </body>: belangrijk!
  • 43. Header region copiëren <div id=&quot;header-region&quot; class=&quot;clear-block&quot;> <?php print $header; ?> </div>
  • 44. .info file: regions Standaard: regions[left] = Left sidebar regions[right] = Right sidebar regions[content] = Content regions[header] = Header regions[footer] = Footer
  • 45. .info file: eigen regions regions[left] = Left sidebar regions[right] = Right sidebar regions[header] = Header regions[footer] = Footer regions[content_top] = Content top regions[content_bottom] = Content bottom regions[navbar] = Navbar regions[helemaalrechtsboven] = Helemaal rechts boven Opm: Bestaande naamgeving best behouden, maar eigen nieuwe toevoegen
  • 46. Logo invoegen <?php if ($logo): ?> <div id=&quot;logo&quot;> <a href=&quot;<?php print $base_path; ?>&quot; title=&quot;<?php print t('Home'); ?>&quot;> <img src=&quot;<?php print $logo; ?>&quot; alt=&quot;<?php print t('Home'); ?>&quot; title=&quot;<?php print t('Home'); ?>&quot; /> </a> </div> <?php endif; ?> En bij Templates logo opladen of logo.png copiëren.
  • 47.
  • 48. Via block visibility settings & pathauto
  • 50. Via meerdere templates: volgens url, user, content type
  • 51.
  • 55. if (arg(1) == 'edit') {}
  • 56. if (arg(0) == 'admin') {}
  • 57. Meerdere page.tpl.php files Frontpage page-front.tpl.php Voor node pad (url)‏ Page-node-edit.tpl.php of page-node-add.tpl.php > page-node-1.tpl.php > page-node.tpl.php > page.tpl.php Volgens url (view of module)‏ page-blog-tpl.php, page-viewpagename.tpl.php, page-admin.tpl.php, page-admin-build-block.tpl.php, page-civicrm.tpl.php, page-googlemap.tpl.php, page-user-1.tpl.php... Let op : volgens url niet voor node aliassen, steeds Drupal path vb node/2
  • 58. Meerdere node.tpl.php Volgens content type node-blog.tpl.php node-forum.tpl.php node-page.tpl.php node-ccknieuwsbericht.tpl.php
  • 59.
  • 60.