Variables in template files In my .tpl.php template files, I have several links and names of external websites. I would like to print these as variables, which are defined in template.php. That way, if I have to change a link, I can just change it in template.php and have them updated in all my tpl.php files. 

How can I do this?

 Steps I have tried 

In this tutorial, it says you can define your variables in themename_preprocess_page(&amp;$variables). You can then call them with &lt;?php print render($page['your_variable_name']); ?&gt;

However, when I try this, I  just get a message stating Notice: Undefined variable: page in include(). The variable also doesn't print.

Also, if I use this method, can I use my variable in all tpl.php files or just the page.tpl.php file?
If you create a variable in themename_preprocess_page(&amp;$variables), it should could be accessed using the variable name itself. Example

function themename_preprocess_page(&amp;$variables) {
  $variables['my_new_variable'] = "String value";
  $variables['my_new_variable_array'] = array(); // Some renderable array.
}


And then in your template you could simply print the first variable directly

&lt;?php print $my_new_variable; ?&gt;


And render the renderable array using the render() function:

&lt;?php print render($my_new_variable_array); ?&gt;


Note: The array keys become the name of the variable, so please make sure to use a unique name to the keys.