1. What is Ctools?
“This suite is primarily a set of APIs and tools to improve the
developer experience”
Controlling the Chaos
2. What is Ctools?
1 Exportables 6 Contexts
2 Ajax Responder 7 Plugins
3 Form Wizard 8 Dependant
4 Modal dialog 9 Content
5 Object Caching 10 Form tools
3. What is Ctools?
“Tools to make it easier for modules to have objects that
live in database or live in code, such as 'default views'.”
01 Exportables
4. What is Ctools?
“Tools to make it easier for the server to handle AJAX
requests and tell the client what to do with them.”
02 AJAX Responder
5. What is Ctools?
“An API to make multi-step forms much easier.”
03 Form Wizard
6. What is Ctools?
“Tool to make it simple to put a form in a modal dialog.”
04 Modal Dialog
7. What is Ctools?
“Tool to make it easier to edit an object across multiple
page requests and cache the editing work.”
05 Object Caching
8. What is Ctools?
“The notion of wrapping objects in a unified wrapper and
providing an API to create and accept these contexts as
input.”
06 Contexts
9. What is Ctools?
“Tools to make it easy for modules to let other modules
implement plugins from .inc files.”
07 Plugins
10. What is Ctools?
“A simple form widget to make form items appear and
disappear based upon the selections in another item.”
08 Dependant
11. What is Ctools?
“Pluggable content types used as panes in Panels and
other modules like Dashboard.”
09 Content
12. What is Ctools?
“Tools to make it easier for forms to deal with AJAX.”
10 Form Tools
13. What is Ctools?
“Tools to make it easier for modules to have objects that
live in database or live in code, such as 'default views'.”
11 Exportables
14. What are Exportables?
A standardized way to define “configuration presets”.
Can be stored in the database or in code
Built in export/import functionality
15. Advantages of Exportables
Portability of configuration settings
Allows configuration to use version control
Allows override/revert functionality
Avoids loading data from database
Allows for Drush and Features integration
35. What is Ctools?
“An API to make multi-step forms much easier.”
03 Form Wizard
36. Advantages of Form Wizard
Multistep forms are hard in Drupal
More like FAPI
Allows for better organization of UI
Allows for better organization of code
37. hook_menu callback form_demo.module
Add required wizard and cache includes
Setup multistep array, form settings, callbacks, Labels and IDs
Load form from cache
Render the actual form
This is the hardest part