How do I add to $page_top in html.tpl.php? I wanted to add a piece of HTML at the top of all pages, right after &lt;body&gt;. In the #drupal IRC channel I got the recommendation to override html.tpl.php in the theme. That works fine. But isn't there some useful hook that I could use, so I don't have to copy html.tpl.php and just add a few lines?

I tried to modify $variables['page']['page_top'] in THEME_preprocess_page() and THEME_preprocess_html() but upon debugging $page_top in html.tpl.php, the changes had been discarded.

How do I do it by hook? And which way is to prefer?
Have a look at how the Drupal core toolbar module does this:

/**
 * Implements hook_page_build().
 *
 * Add admin toolbar to the page_top region automatically.
 */
function toolbar_page_build(&amp;$page) {
  $page['page_top']['toolbar'] = array(
    '#pre_render' =&gt; array('toolbar_pre_render'),
    '#access' =&gt; user_access('access toolbar'),
    'toolbar_drawer' =&gt; array(),
  );
}


This is probably the most correct way of adding something to the page top as you can comfortably use render arrays.