How to access $vars['some'] variables in html.tpl.php template In the template.php, I am using the following code for mytheme_preprocess_page().

 // Return nid for node of type "interface_configuraitons".
    $nid_config = db_select('node', 'n')
        -&gt;fields('n', array('nid'))
        -&gt;fields('n', array('type'))
        -&gt;condition('n.type', 'interface_configuraitons')
        -&gt;execute()
        -&gt;fetchCol();
    //load the configurations
    $configurationNode = node_load($nid_config);
    $interfaceConfig = array();
    $interfaceConfig['driver_url'] = $configurationNode-&gt;field_driver_url['und'][0]['value'];
    $interfaceConfig['driver_port'] = $configurationNode-&gt;field_driver_port['und'][0]['value'];
    $vars['interfaceConfig'] = $interfaceConfig;


While $interfaceConfig is initialized and available in any of the page templates, it is NULL in the html.tpl.php template. I was trying to run mytheme_preprocess_html() without success.

How do I get this preprocessing take place, so it is available in the html.tpl.php template file?
The general rule for any THEMEHOOK.tpl.php file (where THEMEHOOK is something like 'html', 'page', 'node' etc.) is:


The default variables are set in template_preprocess_THEMEHOOK() (eg.
template_preprocess_html)
Any module can add variables using MODULENAME_preprocess_THEMEHOOK() (eg. toolbar_preprocess_html)
The active theme can add variables using THEMENAME_preprocess_THEMEHOOK() (eg. bartik_preprocess_html)


The $variables array (sometimes called $vars) is passed on from function to function in the above order, so each function can expand on or overwrite the variables added before.