Your SlideShare is downloading. ×
0
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Lucius Drupal Development Cursus
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Lucius Drupal Development Cursus

5,197

Published on

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,197
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
233
Comments
1
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. DRUPAL DEV Training <ul><li>Introductie </li></ul><ul><li>Lucius Websystems Robbenkoog 29a 1822 BA Alkmaar 072-564 90 90 [email_address] </li></ul>
  • 2. About Drupal
  • 3. Introductie Drupal <ul><li>Geschiedenis </li></ul><ul><li>Huidige stats </li></ul><ul><li>Drupal association & DrupalCons </li></ul>Drupal
  • 4. Wanneer Drupal? <ul><li>Bedrijfswebsites </li></ul><ul><li>Online communities </li></ul><ul><li>Intranets </li></ul><ul><li>Enterprise oplossingen </li></ul><ul><li>Webwinkel </li></ul><ul><li>Weblog </li></ul><ul><li>Multi site platforms </li></ul><ul><li>And many more.. </li></ul>Drupal
  • 5. Enkele Drupal Features <ul><li>Multi talig </li></ul><ul><li>Version control </li></ul><ul><li>Commentaarsysteem </li></ul><ul><li>Download systeem </li></ul><ul><li>Logs en error-reporting </li></ul><ul><li>Forum </li></ul><ul><li>Blog (+API) </li></ul><ul><li>Poll </li></ul>Drupal <ul><li>Zoekmachine </li></ul><ul><li>Aggregator </li></ul><ul><li>RSS </li></ul><ul><li>Gebruikersrechten – beheer (ACL) </li></ul><ul><li>Multi – site </li></ul><ul><li>Taxonomy </li></ul>
  • 6. Waarom Drupal? <ul><li>Stabiele foundation en gepassioneerde community </li></ul><ul><li>Snel en veilig </li></ul><ul><li>Krachtig en schaalbaar </li></ul><ul><li>Innoverend </li></ul><ul><li>Zeer zoekmachinevriendelijk </li></ul><ul><li>Krachtig en Flexibel templating systeem </li></ul><ul><li>Award winning </li></ul><ul><li>Many more.. </li></ul>Drupal
  • 7. Waarom Drupal? part 2 <ul><li>Modulair systeem </li></ul><ul><li>Hooks </li></ul><ul><li>Content types </li></ul><ul><li>Taxonomy </li></ul><ul><li>Drupal API </li></ul><ul><li>Theming & overriding </li></ul><ul><li>NBS (Node Based System) </li></ul><ul><li>Vele modules werken met elkaar samen  Synergie </li></ul><ul><li>Backend en frontend theming </li></ul>Drupal
  • 8. Waarom Drupal? part 3 <ul><li>Content management op maat </li></ul><ul><li>Content invoer (oa CCK) </li></ul><ul><li>Content output (oa Views) </li></ul>Drupal
  • 9. Benodigde kennis <ul><li>PHP 5 </li></ul><ul><li>MySQL </li></ul><ul><li>SQL </li></ul><ul><li>(X)HTML / CSS & Webstandaarden (W3c) </li></ul><ul><li>FTP </li></ul><ul><li>Localhost voor ontwikkeling </li></ul>Drupal
  • 10. Aftasting kennis in huis <ul><li>Wie heeft wat al gedaan? </li></ul><ul><li>Belangrijke Drupal modules: </li></ul><ul><ul><li>Administration Menu </li></ul></ul><ul><ul><li>CCK </li></ul></ul><ul><ul><li>Views </li></ul></ul><ul><ul><li>Image / assist / api </li></ul></ul><ul><ul><li>Pathauto </li></ul></ul><ul><ul><li>Global redirect </li></ul></ul><ul><ul><li>Token </li></ul></ul><ul><ul><li>Webform </li></ul></ul><ul><ul><li>Poormanscron </li></ul></ul><ul><ul><li>FCK Editor </li></ul></ul><ul><ul><li>Devel </li></ul></ul>Drupal
  • 11. Belangrijke Drupal terminologie <ul><li>Module </li></ul><ul><li>Nodes </li></ul><ul><li>Users </li></ul><ul><li>Blocks </li></ul><ul><li>Pages </li></ul><ul><li>Taxonomy </li></ul><ul><li>Content typen & Content (cck) fields </li></ul><ul><li>Sessions </li></ul>Drupal <ul><li>Hooks </li></ul><ul><li>Theme </li></ul><ul><li>Cron </li></ul><ul><li>Cache </li></ul><ul><li>Input format </li></ul><ul><li>Watchdog </li></ul><ul><li>API </li></ul><ul><li>i18n </li></ul>
  • 12. Drupal File Layout Drupal Bron afbeelding: http://www.ddj.com/linux-open-source/199201603?pgno=5
  • 13. Introductie Drupal modules <ul><li>Hoe om te gaan met open source modules </li></ul><ul><li>Goed kijken hoe ‘contrib’ modules gemaakt zijn. Soms beter dan core modules, omdat die al lang in dev zijn. </li></ul><ul><li>Gebruik de enorm actieve community correcte wijze </li></ul><ul><li>Vele modules werken met elkaar samen </li></ul><ul><li>Drupal werkt veel met titles , naamgeving is belangrijk </li></ul><ul><li>Dagelijks checken: </li></ul><ul><ul><li>Latest Drupal modules http://drupal.org/project/modules?solrsort=ds_project_latest_release%20desc </li></ul></ul><ul><ul><li>http://www.drupal.org/planet </li></ul></ul>Drupal
  • 14. Online Developer resources <ul><li>Module developer's guide http://drupal.org/contributors-guide </li></ul><ul><li>Drupal beyond the basics: http://drupal.org/handbook/customization </li></ul><ul><li>Drupal coding standards: http://drupal.org/coding-standards </li></ul><ul><li>Writing secure code: http://drupal.org/writing-secure-code </li></ul><ul><li>Best practices: http://drupal.org/node/287350 </li></ul><ul><li>Working with Drupal API http://drupal.org/node/326 </li></ul><ul><li>Use of underscore in Drupal functions http://drupal.org/node/70335 </li></ul><ul><li>Guidelines for writing efficient SQL code http://drupal.org/node/559302 </li></ul><ul><li>Creating new content type http://drupal.org/node/231019 </li></ul><ul><li>Using Theme layer http://drupal.org/node/165706 </li></ul>Drupal
  • 15. Online Developer tools <ul><li>Drupal for firebug http://drupal.org/project/drupalforfirebug </li></ul><ul><li>Devel module: http://drupal.org/project/devel </li></ul><ul><li>Cache disable http://drupal.org/project/cache_disable </li></ul><ul><li>Use to check you coding on: http://drupal.org/project/coder </li></ul><ul><li>Use to extensivly check your code on: http://drupal.org/project/coder_tough_love </li></ul><ul><li>Trace http://ar.to/2006/12/easier-drupal-debugging-with-trace </li></ul><ul><li>Looking for a module: http://www.drupalmodules.comLooking for a module: http://www.drupalmodules.com </li></ul>Drupal
  • 16. Developer boeken <ul><li>Pro Drupal development – John vanDyk & Matt Westgate </li></ul><ul><li>Learning Drupal 6 module development – Matt Butcher </li></ul><ul><li>Leveraging Drupal – Victor Kane </li></ul><ul><li>Cracking Drupal – Greg James Knaddison </li></ul>Drupal
  • 17. Coding standards & best practices <ul><li>Coding standards: http://drupal.org/coding-standards </li></ul><ul><li>Writing secure code: http://drupal.org/writing-secure-code </li></ul><ul><li>Best practices: http://drupal.org/node/287350 </li></ul><ul><li>Voorbeeld: </li></ul><ul><ul><li>$string = &quot;Foo $bar&quot;; (PHP) </li></ul></ul><ul><li>Online resources: </li></ul><ul><ul><li>Standards, security and best practices http://drupal.org/node/360052 </li></ul></ul><ul><ul><li>Readme.txt van module coder tough love </li></ul></ul>Drupal
  • 18. Drupal API <ul><li>De Drupal API http://api.drupal.org </li></ul><ul><li>Enkele API functies </li></ul><ul><ul><li>l(); </li></ul></ul><ul><ul><li>url(); </li></ul></ul><ul><ul><li>node_load(); </li></ul></ul><ul><ul><li>node_view() </li></ul></ul><ul><ul><li>arg(); </li></ul></ul><ul><ul><li>t(); </li></ul></ul><ul><ul><li>drupal_get_path(); </li></ul></ul><ul><ul><li>check_plain(); </li></ul></ul><ul><ul><li>variable_set, variable_get() & variable_del() </li></ul></ul><ul><ul><li>database abstraction layer </li></ul></ul>Drupal
  • 19. Database <ul><li>API reference http://api.drupal.org/api/group/database/6 </li></ul><ul><li>Secure code: http://drupal.org/writing-secure-code </li></ul><ul><li>Schema API: http://drupal.org/node/146843 </li></ul><ul><ul><li>Updaten Schema van een module : check system table </li></ul></ul>Drupal
  • 20. Creating modules <ul><li>Creating modules tutorial: http://drupal.org/node/206753 </li></ul><ul><li>API reference http://api.drupal.org </li></ul><ul><li>Hooks http://api.drupal.org/api/group/hooks/6 </li></ul><ul><li>PHP Library: http://w3schools.com/php/ </li></ul><ul><li>SQL Library: http://w3schools.com/sql/ </li></ul><ul><li>Creating modules tutorial: http://drupal.org/node/206753 </li></ul>Drupal
  • 21. Module architectuur <ul><li>Benodigde bestanden: </li></ul><ul><ul><li>.info definiering module info en dependencies </li></ul></ul><ul><ul><li>.module de code </li></ul></ul><ul><li>Optioneel </li></ul><ul><ul><li>LICENSE.txt wordt automatisch door drupal toegevoegd </li></ul></ul><ul><ul><li>README.txt handmatig toevoegen </li></ul></ul><ul><ul><li>.inc voornamelijk voor modules met veel code </li></ul></ul><ul><ul><li>.install </li></ul></ul><ul><ul><li>Help </li></ul></ul><ul><ul><li>Translation files in aparte folder </li></ul></ul><ul><ul><li>Theming files (tpl.php) </li></ul></ul><ul><ul><li>UPGRADE.txt </li></ul></ul>Drupal
  • 22. Module architectuur <ul><ul><li>Naamgeving is zeer belangrijk in module </li></ul></ul><ul><ul><li>Zorg voor unieke id in benaming van module, de naam werkt door in: </li></ul></ul><ul><ul><li>Module map en definiering </li></ul></ul><ul><ul><li>Functies in de module </li></ul></ul><ul><ul><li>Dbase tables system variables </li></ul></ul><ul><ul><li>url </li></ul></ul><ul><ul><li>css classes </li></ul></ul><ul><ul><li>Hooks </li></ul></ul><ul><ul><li>Theming files </li></ul></ul><ul><li>Drupal doorloopt de modules in alfabetische volgorde. </li></ul><ul><li>Het is mogelijk een weight aan een module toe te kennen. </li></ul>Drupal
  • 23. Hooks <ul><li>Uitleg: Wat is een Hook en wat kan je ermee </li></ul><ul><li>Alle acties binnen cms waar je een hook kunt verwachten, daar zit er een. </li></ul><ul><li>Hooks http://api.drupal.org/api/group/hooks/6 </li></ul><ul><li>Cheatsheet http://drupal.org/files/drupal_6_core_hooks_cheat_sheet.pdf </li></ul><ul><li>Demo gebruik van enkele Hooks </li></ul>Drupal
  • 24. Code validatie <ul><li>Demo code validatie in Drupal </li></ul>Drupal
  • 25. Content filtering <ul><li>Demo input formats </li></ul>Drupal
  • 26. Productie filter module <ul><li>Opdracht 1: produceer een filter module </li></ul><ul><li>Definieer module / benodigde files </li></ul>Drupal
  • 27. Productie filter module, tip toevoegen Drupal <ul><li>Opdracht 2: produceer de filter tip </li></ul><ul><ul><li>Zoek correct hook op </li></ul></ul><ul><ul><li>Schrijf de code </li></ul></ul>
  • 28. Productie filter module <ul><li>Opdracht 3: produceer een filter, die ingevoerde tekst analyseert en bij output een woord hierin wijzigd. </li></ul>Drupal
  • 29. Productie filter module <ul><li>Opdracht 4: produceer admin gedeelte je te wijzigen woord kan instellen </li></ul>Drupal
  • 30. Productie filter module <ul><li>De code toegelicht </li></ul><ul><li>Code validatie </li></ul>Drupal
  • 31. i18n opdracht <ul><li>Demo i18n </li></ul><ul><li>Oefening i18n </li></ul>
  • 32. Taxonomy <ul><li>Vocabularies & terms </li></ul><ul><li>Content types & taxonomy </li></ul><ul><li>Taxonomy API functions </li></ul><ul><ul><li>Taxonomy output in theme, voorbeeld </li></ul></ul><ul><li>Kan gebruikt worden door modules (bv forum) </li></ul><ul><li>Check hoe Drupal bv taxonomy_node_get_terms() gebruikt op api.drupal.org </li></ul>
  • 33. Menu system <ul><li>hook_menu() </li></ul><ul><ul><li>Menu item & wildcard voor variabele </li></ul></ul><ul><ul><li>Title </li></ul></ul><ul><ul><li>Page callback </li></ul></ul><ul><ul><li>Page arguments </li></ul></ul><ul><ul><li>Access arguments </li></ul></ul><ul><ul><li>Type </li></ul></ul><ul><ul><ul><li>MENU_NORMAL_ITEM (default, maakt menu item aan) </li></ul></ul></ul><ul><ul><ul><li>MENU_CALLBACK </li></ul></ul></ul>
  • 34. Hook menu <ul><ul><ul><li>MENU_LOCAL_TASK (gebruik werkwoord) </li></ul></ul></ul><ul><ul><ul><li>MENU_DEFAULT_LOCAL_TASK (gebruik werkwoord) </li></ul></ul></ul><ul><ul><li>Weight </li></ul></ul><ul><ul><li>File </li></ul></ul><ul><li>Hooken in bestaande menu items hook_menu_alter() </li></ul><ul><li>Menu tabs </li></ul><ul><li>Verbergen van menu items </li></ul>
  • 35. Enkele API Functies <ul><li>pager_query </li></ul><ul><li>drupal_set_message() </li></ul><ul><li>watchdog() </li></ul><ul><li>cache_clear_all() </li></ul><ul><li>user_access() </li></ul><ul><li>format_date() </li></ul><ul><li>drupal_set_header() </li></ul><ul><li>node_access() </li></ul><ul><li>pager_query </li></ul><ul><li>menu_tree_all_data </li></ul><ul><li>drupal_goto </li></ul><ul><li>function image_get_info </li></ul><ul><li>user_is_logged_in </li></ul>
  • 36. Drupal files systeem <ul><li>Demo file handling in Drupal </li></ul>
  • 37. Form API <ul><li>Form API reference http://api.drupal.org/api/file/developer/topics/forms_api_reference.html </li></ul><ul><li>Form API: http://drupal.org/node/37775 </li></ul><ul><li>Form API upload field :http://drupal.org/node/111782 & http://www.imedstudios.com/labs/node/22 </li></ul><ul><li>Form API Elements reference http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6 </li></ul><ul><li>Form functions http://api.drupal.org/api/group/form_api/6 </li></ul>
  • 38. Enkele ‘Form controls’ <ul><li>Texfield </li></ul><ul><li>Submit </li></ul><ul><li>Checkboxes </li></ul><ul><li>Select </li></ul><ul><li>Hidden </li></ul><ul><li>Radios </li></ul><ul><li>Weight </li></ul><ul><li>Fieldset </li></ul><ul><li>Markup </li></ul><ul><li>Button </li></ul><ul><li>Date </li></ul><ul><li>Password </li></ul><ul><li>Item </li></ul>
  • 39. Enkele ‘Form Attributes’ <ul><li>#theme </li></ul><ul><li>#tree </li></ul><ul><li>#access </li></ul><ul><li>#title </li></ul><ul><li>#default_value </li></ul><ul><li>#maxlenght </li></ul><ul><li>#required </li></ul><ul><li>#weight </li></ul><ul><li>#description </li></ul><ul><li>#prefix & #suffix </li></ul><ul><li>#ahah </li></ul><ul><li>#attributes </li></ul>
  • 40. Form API functies <ul><li>Uitleg van enkele belangrijke form functies: </li></ul><ul><ul><li>http://api.drupal.org/api/group/form_api/6 </li></ul></ul>
  • 41. Form API, Validate <ul><li>Validate functies stanaard </li></ul><ul><li>Validatie functies toevoegen aan een bestaand form </li></ul>
  • 42. Form API, Submit <ul><li>Submit functies standaard </li></ul><ul><li>Submit functies toevoegen aan een bestaand form </li></ul>
  • 43. Productie ‘lingo’ module <ul><li>Nieuwe module aanmaken </li></ul><ul><li>Menu hook </li></ul><ul><li>Alleen definiering velden mbv FAPI </li></ul>
  • 44. Productie ‘lingo’ module <ul><li>Extra veld definieren </li></ul><ul><li>Veld verplicht maken (*) </li></ul>
  • 45. Productie ‘lingo’ module <ul><li>Vergelijken tekstvelden </li></ul><ul><li>Foutmelding wanneer niet gelijk </li></ul><ul><li>Wanneer ‘te raden woord’ leeg: foutmelding uit core </li></ul><ul><li>Wanneer ‘gok’ leeg is: custom foutmelding verschijnt </li></ul>
  • 46. Productie ‘lingo’ module <ul><li>Voorbeeld functionaliteit </li></ul>
  • 47. Productie ‘lingo’ module <ul><li>Voorbeeld functionaliteit </li></ul>
  • 48. Productie ‘lingo’ module <ul><li>Productie 2e menu hook </li></ul><ul><li>Validatie veld: altijd 6 karakters, kleine letter, geen cijfers </li></ul><ul><li>Opslaan veld in dbase </li></ul>
  • 49. Productie ‘lingo’ module <ul><li>Melding geven wanneer nieuwe invoer voor oplossing gevalideerd is </li></ul>
  • 50. Productie ‘lingo’ module <ul><li>Antwoord verborgen inladen </li></ul><ul><li>Vergelijken van invoer met antwoord </li></ul><ul><li>1e letter weergeven van antwoord </li></ul>
  • 51. Productie ‘lingo’ module <ul><li>Foutmelding bij verkeerde gok </li></ul><ul><li>Log toevoegen: welke waarden zijn al gegokt. </li></ul><ul><li>Waarden schrijven naar ‘watchdog’ (log) </li></ul>
  • 52. Productie ‘lingo’ module <ul><li>Je hebt max 6 pogingen, daarna verschijnt antwoord </li></ul><ul><li>Log op beeld leeg na 6 pogingen </li></ul><ul><li>Counter resetten, zodat je opnieuw kan proberen </li></ul>
  • 53. Productie ‘lingo’ module <ul><li>Oplossing is goed </li></ul><ul><li>Log in beeld leegmaken </li></ul><ul><li>Goedmelding geven </li></ul>
  • 54. Productie ‘lingo’ module <ul><li>Permissies toevoegen </li></ul>
  • 55. Diverse demo’s <ul><li>Demo multiple-page </li></ul><ul><li>Demo multi button </li></ul><ul><li>Demo Captcha implementatie </li></ul>
  • 56. Database Schema API <ul><li>Demo gebruik Database Schema API </li></ul><ul><ul><li>.install file </li></ul></ul><ul><li>Oefening gebruik Database Schame API </li></ul>
  • 57. Drupal Theming System
  • 58. Theming system <ul><li>xHTML / CSS </li></ul><ul><li>Javascript & jQuery </li></ul><ul><li>Custom vs voorgecodeerd </li></ul><ul><li>Veel themes beschikbaar </li></ul><ul><li>Garland als voorbeeld theme </li></ul><ul><li>Garland als backend theme </li></ul>
  • 59. Online resources <ul><li>Anatomy of Drupal 6 theme http://drupal.org/node/171194 </li></ul><ul><li>Drupal 6 theming documentation http://drupal.org/theme-guide/6 </li></ul><ul><li>Core tpl-files and vars (cheat sheet) http://drupal.org/node/190815 </li></ul><ul><li>Drupal coding documentation: http://drupal.org/node/360052 </li></ul><ul><li>Secure code http://drupal.org/writing-secure-code </li></ul><ul><li>Use the Theme developer module http://drupal.org/project/devel </li></ul><ul><li>HTML en CSS tools en techniques http://drupal.org/node/37156 </li></ul><ul><li>Theming forum http://drupal.org/forum/3 </li></ul><ul><li>Theming layer in modules http://drupal.org/node/165706 </li></ul>
  • 60. Theme anatomy Bron afbeelding:http://drupal.org/node/171194
  • 61. Enkele Theme Files <ul><li>In Folder : sites/all/themes/[theme_naam] </li></ul><ul><li>.info </li></ul><ul><li>page.tpl.php </li></ul><ul><li>node.tpl.php </li></ul><ul><li>block.tpl.php </li></ul><ul><li>template.php </li></ul><ul><li>page-front.tpl.php </li></ul><ul><li>Images folder </li></ul><ul><li>Css folder </li></ul><ul><li>Screenshot.png </li></ul><ul><li>Comment.tpl.php </li></ul><ul><li>Favicon </li></ul>
  • 62. Enkele Theme Files <ul><li>.info variabelen: http://drupal.org/node/171205 deafults: http://drupal.org/node/171206 theme_get_registry() </li></ul><ul><li>page.tpl.php http://api.drupal.org/api/file/modules/system/page.tpl.php/6 </li></ul><ul><li>node.tpl.php http://api.drupal.org/api/file/modules/node/node.tpl.php/6 </li></ul>
  • 63. Features en color <ul><li>Toevoegen features http://drupal.org/project/themesettingsapi </li></ul><ul><li>Color module http://drupal.org/node/108459 </li></ul>
  • 64. Regions <ul><li>Assignen van blocks/content aan regions http://drupal.org/node/171224 </li></ul><ul><li>Demo inrichten regions </li></ul>
  • 65. Theme variables <ul><li>$styles </li></ul><ul><li>$scripts </li></ul><ul><li>$head </li></ul><ul><li>$content </li></ul><ul><li>$closure </li></ul><ul><li>$base_path </li></ul><ul><li>$language </li></ul><ul><li>print $ regionname </li></ul><ul><li>$directory </li></ul><ul><li>$tabs </li></ul><ul><li>$tabs2 </li></ul><ul><li>$title </li></ul><ul><li>$breadcrumb </li></ul><ul><li>$show_messages /$messages </li></ul><ul><li>$help </li></ul><ul><li>$front_page </li></ul><ul><li>$is_front </li></ul><ul><li>Core templates (cheat sheet) http://drupal.org/node/190815 </li></ul>
  • 66. Enkele API functies voor theming <ul><li>format_date() </li></ul><ul><li>l() </li></ul><ul><li>url() </li></ul><ul><li>t() </li></ul><ul><li>Sanitizing functions </li></ul><ul><ul><li>check_plain() </li></ul></ul><ul><ul><li>check_markup() </li></ul></ul><ul><ul><li>filter_access() </li></ul></ul><ul><ul><li>filter_xss_admin() </li></ul></ul><ul><li>drupal_add_css() </li></ul>
  • 67. API functions in theme <ul><li>Demo API functions in theme aanroepen </li></ul>
  • 68. Theme overriding <ul><li>“ Overriding”, dus geen “overwriting” </li></ul><ul><li>pages </li></ul><ul><li>blocks </li></ul><ul><li>tpl.php files in modules </li></ul><ul><li>Overriden van tpl files mbv theme functies </li></ul><ul><li>Standaard Drupal functions: </li></ul><ul><ul><li>theme('item_list') </li></ul></ul><ul><ul><li>theme(’table’) </li></ul></ul>
  • 69. Overriding voorbeeld <ul><li>pages </li></ul><ul><ul><li>Page- [front|internal/path].tpl.php </li></ul></ul><ul><li>blocks </li></ul><ul><ul><li>Block- modulename-delta.tpl.php </li></ul></ul><ul><ul><li>Block- modulename.tpl.php </li></ul></ul><ul><ul><li>Block-region.tpl.php </li></ul></ul><ul><ul><li>Block.tpl.php </li></ul></ul>
  • 70. Theme hooks & overriding <ul><li>Functions in modules (theme_%) </li></ul><ul><ul><li>http://api.drupal.org/api/group/themeable/6 </li></ul></ul><ul><li>Overriden van tpl files mbv theme functies </li></ul><ul><li>Sinds D6: registreren theme hooks </li></ul><ul><li>Theme registry & cache </li></ul>
  • 71. Custom variables in theme <ul><li>http://drupal.org/node/223430 </li></ul><ul><li>Extra variabelen toevoegen in preprocessing </li></ul><ul><ul><li><?php function template_preprocess_foo(&$variables) {   $variables['foo_list'] = array(    'list item 1',    'list item 2',    'list item 3',  ); } ?> </li></ul></ul><ul><li>Wijzigen/ toevoegen data aan bestaande variabelen. </li></ul>
  • 72. Theming tools <ul><li>Devel module </li></ul><ul><li>Validatie html & css. http://validator.w3.org </li></ul><ul><li>Firefox: </li></ul><ul><ul><li>Drupal for firebug. http://drupal.org/project/drupalforfirebug </li></ul></ul><ul><ul><li>Web developer toolbar </li></ul></ul><ul><ul><li>Firebug </li></ul></ul><ul><ul><li>Yslow </li></ul></ul><ul><ul><li>Total validator </li></ul></ul>
  • 73. Oefening <ul><li>Registreer theme </li></ul><ul><li>Screenshot toevoegen </li></ul><ul><li>Theme activeren in Front-end </li></ul>
  • 74. Oefening <ul><li>Implementeer statische html </li></ul><ul><ul><li>mbv theme files en variables </li></ul></ul>
  • 75. Oefening <ul><li>Regio’s definieren </li></ul>
  • 76. Oefening <ul><li>Themen page, variabelen inladen </li></ul>
  • 77. Oefening <ul><li>Menu items themen </li></ul><ul><li>Block themen </li></ul><ul><li>List page themen mbv: </li></ul><ul><ul><li>Views </li></ul></ul><ul><ul><li>CCK </li></ul></ul><ul><ul><li>Imagefield (+dependecies) </li></ul></ul><ul><ul><li>Imagecache </li></ul></ul><ul><ul><li>Image api </li></ul></ul><ul><ul><li>+ dependencies </li></ul></ul>
  • 78. Oefening <ul><li>List page themen mbv menu hook in custom module </li></ul><ul><li>Submenu afhankelijk van hoofdmenu tonen </li></ul><ul><li>Submenu active state themen </li></ul>
  • 79. Oefening, CCK themen <ul><li>Extra content type definieren </li></ul><ul><li>Met CCK velden definieren </li></ul><ul><li>Output voor die velden themen </li></ul><ul><li>De custom ‘CCK’ velden: </li></ul><ul><ul><li>Image mbv: Imagecache </li></ul></ul><ul><ul><li>Introtekst </li></ul></ul>
  • 80. Divers <ul><li>Demo Multi site theming </li></ul><ul><li>Demo LTR / RTL (Left To Right / Right To Left) </li></ul><ul><li>Demo Subtheming </li></ul>
  • 81. Oefening <ul><li>Oefening Multi site theming </li></ul><ul><li>Oefening LTR / RTL (Left To Right / Right To Left) </li></ul><ul><li>Oefening Subtheming </li></ul>
  • 82. Afsluiting, wrap it up

×