How do you create a variable from hook_preprocess_page() that will be available to a node template? I have this in my module "spot":

function spot_preprocess_page(&amp;$vars) {
  $vars['social'] = 'hi';
}


Other things I set in this function come through fine. But my node--spot.tpl.php template is complaining that the variable does not exist:


  Notice: Undefined variable: social


I have cleared the cache.

What am I doing wrong?
How do you create a variable from hook_preprocess_page() that will be available to a node template?


You cannot.
The parameter passed to hook_preprocess_page() (what you define as &amp;$vars) is not the same parameter passed to hook_preprocess_node(), which means that if you set $vars['social'] in the first, it is not passed to the latter. If you need to pass a value to the node template file, you need to set it in hook_preprocess_node(), or hook_process_node().