46d391e0f9538c962ba8f5c5d35a9e41117d39f4
 context.core.inc                        |    3 +++
 context.plugins.inc                     |   15 ++++++++++++++-
 plugins/context_reaction_menu_trail.inc |   21 +++++++++++++++++++++
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/context.core.inc b/context.core.inc
index 5a85e8a..68bb670 100644
--- a/context.core.inc
+++ b/context.core.inc
@@ -314,6 +314,9 @@ function context_context_page_reaction() {
   if ($plugin = context_get_plugin('reaction', 'breadcrumb')) {
     $plugin->execute();
   }
+  if ($plugin = context_get_plugin('reaction', 'menu_trail')) {
+    $plugin->execute();
+  }
   if ($plugin = context_get_plugin('reaction', 'css_injector')) {
     $plugin->execute();
   }
diff --git a/context.plugins.inc b/context.plugins.inc
index 46dfac1..2ffafa2 100644
--- a/context.plugins.inc
+++ b/context.plugins.inc
@@ -116,10 +116,15 @@ function _context_context_registry() {
   );
   if (module_exists('menu')) {
     $registry['reactions']['menu'] = array(
-      'title' => t('Menu'),
+      'title' => t('Menu class'),
       'description' => t('Control menu active class using context.'),
       'plugin' => 'context_reaction_menu',
     );
+    $registry['reactions']['menu_trail'] = array(
+      'title' => t('Menu trail'),
+      'description' => t('Set the current page to behave like a child of the selected menu item.'),
+      'plugin' => 'context_reaction_menu_trail',
+    );
   }
   if (module_exists('css_injector')) {
     $registry['reactions']['css_injector'] = array(
@@ -302,6 +307,14 @@ function _context_context_plugins() {
       'parent' => 'context_reaction',
     ),
   );
+  $plugins['context_reaction_menu_trail'] = array(
+    'handler' => array(
+      'path' => drupal_get_path('module', 'context') . '/plugins',
+      'file' => 'context_reaction_menu_trail.inc',
+      'class' => 'context_reaction_menu_trail',
+      'parent' => 'context_reaction_menu',
+    ),
+  );
   $plugins['context_reaction_theme'] = array(
     'handler' => array(
       'path' => drupal_get_path('module', 'context') . '/plugins',
diff --git a/plugins/context_reaction_menu_trail.inc b/plugins/context_reaction_menu_trail.inc
new file mode 100644
index 0000000..3444103
--- /dev/null
+++ b/plugins/context_reaction_menu_trail.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Set the menu trail using a context reaction.
+ */
+class context_reaction_menu_trail extends context_reaction_menu {
+  /**
+   * Override of execute(). Set the menu item.
+   */
+  function execute() {
+    $item = menu_get_item();
+    $contexts = $this->get_contexts();
+    foreach ($contexts as $context) {
+      if (!empty($context->reactions[$this->plugin])) {
+        $item['href'] = $context->reactions[$this->plugin];
+        menu_set_item(NULL, $item);
+        break;
+      }
+    }
+  }
+}
