How do I insert HTML onto every page? I've got the following code in my module. I'm trying to get it to insert some HTML, ideally at the start of &lt;body&gt;, but it seems that my call in hook_init() isn't working - what would be the right hook to call this in? I'm hoping it will just render slidedown.tpl.php after &lt;body&gt;.

&lt;?php
function slidedown_init() {
    drupal_add_js(drupal_get_path('module', 'slidedown') . '/slidedown.js');
    drupal_add_css(drupal_get_path('module', 'slidedown') . '/slidedown.css');
    slidedown_insert_html();
}

function slidedown_insert_html() {
    return theme('slidedown_template');
}

function slidedown_theme() {
    $themes = array (
        'slidedown_template' =&gt; array(
            'template' =&gt; 'slidedown', // your template file called slidedown.tpl.php
            'arguments' =&gt; array(),
        ),
    );
    return $themes;
}
?&gt;
You probably want hook_page_build():

function slidedown_page_build (&amp;$page) {
  $path = drupal_get_path('module', 'slidedown');

  drupal_add_js($path . '/slidedown.js');
  drupal_add_css($path . '/slidedown.css');

  $page['page_top']['slidedown_template'] = array(
    '#weight' =&gt; -1000, 
    '#markup' =&gt; theme('slidedown_template'),
  );
}


I can't remember if that hook is too late to add JS and CSS.  You may need to put those in a template_preprocess_html().  That is a better choice that hook_init().