How do you go about using contexts and a menu page callback? Currently we have a page that is generated by a hook menu page callback. The path is structured like menu/%location_name/menu/%parent_category/%child_category. The function requires at least one of the category wildcards to properly work. 

In the page callback we then set up our context's condition which is to determine which of the categories we're in. See code below:

  if(empty($term_parent) == FALSE || empty($term_parent) == FALSE) {
    if ($plugin = context_get_plugin('condition', 'ss_menu_core_condition_default')) {
      if(empty($term_parent) == FALSE &amp;&amp; empty($term_child) == TRUE) {
        $context_term = $term_parent-&gt;tid;
      } elseif(empty($term_parent) == FALSE &amp;&amp; empty($term_child) == FALSE) {
        $context_term = $term_child-&gt;tid;
      }
      $plugin-&gt;execute($context_term);
    }
  }


Everything up until this point makes a bit of sense to me. And currently it validates fine and I can actually see the context when using context_active_contexts(). Although the gotcha that I must be missing is how do i go about allowing the metatags context module's reaction to use this term for token replacement? 

At first the tokens avaliable were pretty generic default site wide things such as current page, current user, date, etc... It wasn't until i found a patch that taxonomy terms ended up showing up as token replacements. But none of them seemed to work as it seemed the context didn't know of what term to use. 

This leaves me at a point where I felt like the only solution was to do something hackish and just set my values in the active context as follows:

  $context = context_active_contexts();
  $context['ss_menu_core_menu_sections']-&gt;reactions['metatag_context_reaction']['metatags']['und']['description']['value'] = $context_term-&gt;description;


This still doesn't feel right at this point since we can't actually use the metatags reaction form to populate the values. If anyone has any ideas that would be amazing. 

Thanks.
Take a cue from metatag_context_entity_prepare_view() in that patch.  You need to stuff your desired term entities into the metatag_context_entities static variable in your page callback like so:

drupal_static('metatag_context_entities', array('taxonomy_term', $terms));