Need help with template_preprocess_node I have a block with a select box and submit button. The main purpose of the select box is to store a variable in the session. I used template_preprocess_node to filter contents based on user selection.

function blackout_preprocess_node(&amp;$vars) {
  $node = $vars['node'];

  // define a variable to hold your rendered content
  $newContent = "";

  if($_SESSION['myid'] == '1' &amp;&amp; $node-&gt;field_field1[0]['value'] != '') {
    $newContent = $node-&gt;field_field1[0]['view'];
  } else if($_SESSION['myid'] == '2' &amp;&amp; $node-&gt;field_field2[0]['value'] != '') {
    $newContent = $node-&gt;field_field2[0]['view'];
  } else {
    $newContent = $node-&gt;body;
  }
  if (strlen($newContent)) $vars['content'] = $newContent;
}


Everything is working fine except I have to click submit twice to reload the page contents or I have to move to another page to see re-loaded content. How can I reload content with just one click?
Blocks are rendered in hook_preprocess_page. At that time, all implementations of hook_preprocess_node have already been executed, so you cannot influence how the node is displayed (apart from messing with the HTML in $vars['content']).

If you use Drupal's Form API to implement the select list and the submit button, Drupal will redirect you after submitting the form, so you do not need to reload the page manually. See Post/Redirect/Get for why it is generally a good idea to redirect after a HTTP Post.