trying to add a template file to my module using hook_theme_registry_alter Here's my .module code:

/**
 * Implements hook_theme_registery_alter()
 */
function popover_theme_registery_alter(&amp;$theme_registery) {
    $theme_registery['popover'] = array(
        'template' =&gt; drupal_get_path('module','popover'). '/popover.tpl.php',
        'type' =&gt; 'module',
    );
}


I'm having some plain html elements in the tpl.php file so that might be not good? or do I have to call this hook somewhere? what's wrong?
I'd imagine you should be using hook_theme() instead of hook_registry_alter() to define your theme function:

function MYMODULE_theme() {
  return array(
    'popover' =&gt; array(
      'template' =&gt; 'popover',
      'variables' =&gt; array('var1' =&gt; array(), 'var2' =&gt; '')
    )
  );
}


Then you can call it from anywhere (including a page callback, which I think is where you're trying to return this from given your comment above):

$output = theme('popover', array('var1' =&gt; $var1, 'var2' =&gt; $var2));


In the popover.tpl.php file in your module's root folder you'll have access to the variables $var1 and $var2, which will be the vars you defined/passed into the theme function.

Then you can build up your HTML as you need.