Variable in html.tpl.php This seemingly simple task proved more difficult than I imagined.. I'm trying to get a variable from themename_preprocess_html to my html.tpl.php.

The code I have in my template.php file:

&lt;?php
function themename_preprocess_html(&amp;$variables) {
  $variables['test'] = "Hello world!";
}


And in my html.tpl.php file I have:

&lt;?php print($test); ?&gt;


Unfortunately, the variable isn't displayed in the page. It says:

Notice: Undefined variable: test in include()


I'm trying to do this so I can use node fields to determine variables in my stylesheet.

Is there any way I can print all available variables in my html.tpl.php?
Try using get_defined_vars() to get the list of all the variables on a page.


  get_defined_vars — Returns an array of all defined variables


Source - http://php.net/manual/en/function.get-defined-vars.php