| 1 |
$Id$
|
| 2 |
|
| 3 |
Context for Drupal 6.x
|
| 4 |
|
| 5 |
Installation
|
| 6 |
------------
|
| 7 |
Context can be installed like any other Drupal module -- place it in
|
| 8 |
the modules directory for your site and enable it (and its requirement,
|
| 9 |
context) on the admin/build/modules page.
|
| 10 |
|
| 11 |
You will probably want to install context_contrib and context_ui as well.
|
| 12 |
context_contrib provides basic context integration for several contrib
|
| 13 |
modules including Views and context_ui provides a way for you to edit
|
| 14 |
contexts through the Drupal admin interface.
|
| 15 |
|
| 16 |
Basic usage
|
| 17 |
-----------
|
| 18 |
Context allows you to manage contextual conditions and reactions for
|
| 19 |
different portions of your site. You can think of each context as
|
| 20 |
represemting a "section" of your site. For each context, you can choose
|
| 21 |
the conditions that trigger this context to be active and choose different
|
| 22 |
aspects of Drupal that should respond to this active context.
|
| 23 |
|
| 24 |
Think of conditions as a set of rules that are checked during page load
|
| 25 |
to see what context is active. Any reactions that are associated with
|
| 26 |
active contexts are then fired.
|
| 27 |
|
| 28 |
Example
|
| 29 |
-------
|
| 30 |
You want to create a "pressroom" section of your site. You have a press
|
| 31 |
room view that displays press release nodes, but you also want to tie
|
| 32 |
a book with media resources tightly to this section. You would also
|
| 33 |
like a contact block you've made to appear whenever a user is in the
|
| 34 |
pressroom section.
|
| 35 |
|
| 36 |
1. Add a new context on admin/build/context
|
| 37 |
2. Set the value to "pressroom"
|
| 38 |
3. Under the "set context" dialogue, associate the pressroom nodetype,
|
| 39 |
the pressroom view, and the media kit book with the context.
|
| 40 |
4. Choose the pressroom menu item to be set active under the "respond
|
| 41 |
to context" items.
|
| 42 |
5. Add the contact block to a region under the block visibility
|
| 43 |
settings.
|
| 44 |
6. Save the context.
|
| 45 |
|
| 46 |
Hooks
|
| 47 |
-----
|
| 48 |
hook_context_conditions()
|
| 49 |
Provides an array of FormAPI definitions. Allows you to provide
|
| 50 |
additional conditions for setting a context.
|
| 51 |
|
| 52 |
Example: context_context_conditions()
|
| 53 |
|
| 54 |
hook_context_reactions()
|
| 55 |
Provides an array of FormAPI definitions. Allows you to provide
|
| 56 |
additional reactions that respond to a set context.
|
| 57 |
|
| 58 |
Example: context_context_reactions()
|
| 59 |
|
| 60 |
hook_context_default_contexts()
|
| 61 |
Provides an array of exported context definitions. Allows you
|
| 62 |
to provide default contexts in your modules.
|
| 63 |
|
| 64 |
hook_context_default_contexts_alter()
|
| 65 |
A drupal_alter() that acts on the collected array of default
|
| 66 |
contexts before they are cached.
|
| 67 |
|
| 68 |
hook_context_active_contexts_alter()
|
| 69 |
A drupal_alter() that acts on the collected array of active
|
| 70 |
contexts on a given page load.
|
| 71 |
|
| 72 |
hook_context_links_alter()
|
| 73 |
A drupal_alter() that acts on the contextual links provided
|
| 74 |
to page.tpl.php.
|
| 75 |
|
| 76 |
Maintainers
|
| 77 |
-----------
|
| 78 |
yhahn (Young Hahn)
|
| 79 |
jmiccolis (Jeff Miccolis)
|
| 80 |
|
| 81 |
Contributors
|
| 82 |
------------
|
| 83 |
dmitrig01 (Dmitri Gaskin)
|
| 84 |
Pasqualle (Csuthy Bálint)
|
| 85 |
|