how to access node variables in region preprocess function? I have variable in the node preprocessor:

function theme_preprocess_node(&amp;$vars , $hook) {
    $vars['default_product_price'] = $vars['elements']['product:commerce_price'][0]['#markup'];
}


Currently, the variable 'default_product_price' is not available in the region--sidebar-second.tpl.php file. How would i make this variable available in region template file or page template file? Thank You
The template files for nodes and pages don't share any variable; that is true also for their preprocess and process functions.

Assuming we are talking of a node field implemented with the field API, then what follows applies:


The page preprocess and process functions have access to $variables['node'] which contains the node object, in the case the page is a node page 

function mytheme_preprocess_page(&amp;$variables) {
  if (!empty($variables['node'])) {
    $node = $variables['node'];
    // …
  }
}

The function to access the content of a entity field is field_get_items(), which returns its raw content
The function to render a entity field is field_view_value()


The following code should work.

  function mytheme_preprocess_page(&amp;$variables) {
    if (!empty($variables['node'])) {
      $output = '';
      $node = $variables['node'];
      $items = field_get_items('node', $node, 'field name');
      foreach ($items as $item) {
        $field_output = field_view_value('node', $node, 'field name', $item);
        $output .= render($field_output);
      }
      // Set $variables with the value you need.
    }
  }


Unfortunately, $variables['view_mode'] is passed only to the node preprocess/process functions; that value would be helpful to field_view_value(), as its last parameter is the view mode.