Custom theme for module? I am creating a new module in drupal 7 called coolmodule and I'm trying to figure out how to bind content to the file sites/all/modules/coolmodule/coolmodule.tpl.php file.  Here's the block view code in my coolmodule.module;

function coolmodule_block_view($delta = '') {

    $block['subject'] = t('My Special Module');


    $block['content'] = theme('coolmodule', array('myvar' =&gt; 'helloworld'));

    return $block;
}


But for some reason, pages with this block does not render sites/all/modules/coolmodule/coolmodule.tpl.php.  What am I doing wrong?
you are missing a hook_theme() function

see you defined a theme for your block by using:

$block['content'] = theme('coolmodule', array('myvar' =&gt; 'helloworld'));


but you never told it how to relate your theme with the template file, this work is done in hook_theme() function.

function coolmodule_theme() {
    $items['coolmodule'] = array(
        'template' =&gt; 'coolmodule',   // here comes your template name
        'render element' =&gt; 'content'
    );

    return $items;
}


Don't forget to clear your cache