How to place custom module template file in theme folder I am using Drupal 6, and I have created a custom module which is in the  "sites\all\modules\custom" folder; in the same folder there is also the custom.tpl.php file.  

I want to place the custom.tpl.php file in the theme folder.  

Here is my code:  

function custom_menu() {
  $items = array();

  $items['custom'] = array(
    'page callback' =&gt; 'custom_page',
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );

  return $items;
}

function custom_page() {
  $result = db_query('SELECT * from node');
  return theme('custom', array('output' =&gt; $result));
}

function custom_theme() {
  return array(
    'custom' =&gt; array(
      'arguments' =&gt; array('output' =&gt; NULL),
      'template' =&gt; 'custom',
     ),
  );
}

function template_preprocess_custom(&amp;$variables) {}
Well you can place in the theme folder or you can leave it in the module. Drupal will look in both places. So if your implementation of hook_theme is a template, Drupal will look for the following files:


themes/bluemarine/custom.tpl.php
modules/custom/custom.tpl.php


If you read the documentation for hook_theme you'll get your answer for the question when you get to the path key:


  path: [...] Ordinarily the module or theme path will be used [...]