override node.tpl.php in a module I created a module that should be able to display the content of a certain content type. The displaying is kinda complex and to be able to turn it off and to group everything together i created a module for this.

But in the end it should just override the normal node.tpl.php with a custom .tpl.php file. When i put the file in my template folder it gets picked up and the pages shows as intended, but i can't get it to work when the file is in module folder.

I read a lot of things about regsiter the .tpl file and preprocess but nothing that combines the pieces i need.

This is what i have so far

function apps_theme($existing, $type, $theme, $path) {
    $items = array(
        'node--app' =&gt; array(
            'template' =&gt;  drupal_get_path('module', 'app') . '/node--app',
            'variables' =&gt; array('node' =&gt; (object)array())
        )
    );
    return $items;
}

function apps_preprocess_node(&amp;$vars) {
    $variables['theme_hook_suggestions'][] = 'node__app';
}
It is not clear in your question if you are placing your template in sites/all/custom/modules, or in sites/all/custom/modules/the_name_of_mymodule. It needs to be the later.

However, if you:


Have your template in the proper place.
Visited the admin/appearance path to force a theme registry refresh.
Cleared all the caches aftewards.


...but still no dice, you can always specify in your hook_theme() implementation the theme_path key:

&lt;?php
function apps_theme($existing, $type, $theme, $path) {
    $items = array(
        'node_app' =&gt; array(
            // Don't specify the path in the template name.
            // Unless you have your template inside a directory within this module.
            'template' =&gt;  'node--app',
            'variables' =&gt; array('node' =&gt; (object)array()),
            // If you want to put the tpl in another location, you can use this key.
            'theme path' =&gt; drupal_get_path('module', 'another_module'),
        ),
    );
    return $items;
}