Action contexts work in combination with response_contexts to output additiona formats, such as RSS or JSON.

Typically, you check whether the controller passed in the arguments is one defined by your plugin, then add your context (output format) to the array of values.

Then, response contexts you define direct Omeka to the views you have defined for the output.


array $contexts
Array of the contexts available for a controller’s views.


Omeka_Controller_Action controller
The controller that is producing the output.

`Zend_Controller_ActionHelper_ContextSwitch <> context_switch


Make an RSS feed of your records available at /my-records/browse?output=rss

class MyRecordController extends Omeka_Controller_AbstractActionController
    //nothing to do here, since we don't need to override anything

class MyPlugin extends Omeka_Plugin_AbstractPlugin
    protected $_filters = array('define_action_context');

    public filterDefineActionContext($contexts, $args)
        if($args['controller'] instanceof MyRecordController) {
            $contexts['browse'][] = 'rss';
        return $contexts;