Your SlideShare is downloading. ×

Modules Building Presentation

650

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
650
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
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 Training Module Building
    • 2. Preparing for Development
    • 3. Preparing for Development • Have a clear development workflow
    • 4. Preparing for Development • Have a clear development workflow • Learn (and adopt) Drupal’s coding standards
    • 5. Preparing for Development • Have a clear development workflow • Learn (and adopt) Drupal’s coding standards • Take time to invest in your tools
    • 6. Drupal’s Extenisbility
    • 7. Drupal’s Extenisbility • Drupal’s goal is “infinite extensibility” - this is what Drupal is generally optimizing for
    • 8. Drupal’s Extenisbility • Drupal’s goal is “infinite extensibility” - this is what Drupal is generally optimizing for • The same APIs that define Drupal’s core functionality are available to you as a module developer
    • 9. Drupal’s Extenisbility • Drupal’s goal is “infinite extensibility” - this is what Drupal is generally optimizing for • The same APIs that define Drupal’s core functionality are available to you as a module developer • The hook system!
    • 10. The Anatomy of a Module
    • 11. The Anatomy of a Module • my_module.info
    • 12. The Anatomy of a Module • my_module.info • my_module.module
    • 13. The Anatomy of a Module • my_module.info • my_module.module • my_module.install
    • 14. Database Abstraction Layer
    • 15. Database Abstraction Layer • Drupal provides a procedural wrapper to provide support for multiple types of databases (essentially MySQL and PostgreSQL)
    • 16. Database Abstraction Layer • Drupal provides a procedural wrapper to provide support for multiple types of databases (essentially MySQL and PostgreSQL) • A thin (and somewhat outdated) wrapper around the underlying SQL
    • 17. Database Abstraction Layer • Drupal provides a procedural wrapper to provide support for multiple types of databases (essentially MySQL and PostgreSQL) • A thin (and somewhat outdated) wrapper around the underlying SQL • On it’s way out (Drupal 7 introduces a new db layer based on PDO)
    • 18. db_query()
    • 19. db_query() • run a basic query in the active database
    • 20. db_query() • run a basic query in the active database • any number of arguments are substituted into the query using printf() syntax.
    • 21. db_fetch_result()
    • 22. db_fetch_result() • Return an individual result (not row) from the previous query
    • 23. db_fetch_result() • Return an individual result (not row) from the previous query
    • 24. db_fetch_object db_fetch_array
    • 25. db_fetch_object db_fetch_array • db_fetch_object() and db_fetch_array() fetch a row from the previous query as an object or array, respectively
    • 26. db_fetch_object db_fetch_array • db_fetch_object() and db_fetch_array() fetch a row from the previous query as an object or array, respectively
    • 27. drupal_write_record()
    • 28. drupal_write_record() • Write or update a record in the database based upon the schema starting with an object or array
    • 29. drupal_write_record() • Write or update a record in the database based upon the schema starting with an object or array
    • 30. The Hook System
    • 31. The Hook System • both core and contrib provide a set of “hooks” that your module can implement to add functionality to existing operations
    • 32. The Hook System • both core and contrib provide a set of “hooks” that your module can implement to add functionality to existing operations • your module registers to be notified of a particular operation by implementing a hook
    • 33. The Hook System • sample hook: • sample implementation: • called by:
    • 34. The Anatomy of the php template engine
    • 35. The Anatomy of the php template engine • Files
    • 36. The Anatomy of the php template engine • Files • .info
    • 37. The Anatomy of the php template engine • Files • .info • .template
    • 38. The Anatomy of the php template engine • Files • .info • .template • .tpl.php
    • 39. The Anatomy of the php template engine • Files • .info • .template • .tpl.php • javascript/css/images
    • 40. Anatomy cont.
    • 41. Theme Registry
    • 42. Theme Registry • modules must implement hook_theme to declare their themable functions and templates
    • 43. Theme Registry • modules must implement hook_theme to declare their themable functions and templates • these functions must be titled theme_function_name
    • 44. Theme Registry • modules must implement hook_theme to declare their themable functions and templates • these functions must be titled theme_function_name • theme(‘function_name’, $param) is then used to call the function
    • 45. Implementing hook_theme()
    • 46. Providing a default theme function
    • 47. Providing a default template

    ×