Register a module theme implementations I have created a simple module to display frequently asked questions (FAQ). The output (faq content) can be customize in mymodule-template.tpl.php file located in a module directory.

I'd like to create an additional template file suggestion for the theme directory e.g: sites/all/themes/mytheme/templates/mymodule-template.tpl.php

So, the main goal is to add two template file suggestions.


[my module path]/mymodule-template.tpl.php
[active theme path]/templates/mymodule-template.tpl.php


To achieve #1 I have implemented this hook.

/**
 * Implements hook_theme()
 * @return
 *  An array with the name of template file and variables
 */
function simple_faq_theme($existing, $type, $theme, $path) {
    // get faq content
    $records     = get_faq_content();   // categories, questions, answers
    $description = get_faq_info('intro');   // faq description

    return array(
        'faq_template'  =&gt; array(
          'template'    =&gt; 'simple_faq',
          'variables'   =&gt; array('records' =&gt; $records, 'description' =&gt; $description),
        )
    );
}


/**
 * FAQ Page content
 *
 * @return
 *  HTML created by template file
 */ 
function simple_faq_page() {
    return theme('faq_template');
}


It works, but I can't figure out how to create an additional suggestion, which allows users to theme the output without changing anything within module files.

Any idea?
Your hook_theme implementation is not being done in the usual way.
It should only have default values for the variables, like this:

/**
 * Implements hook_theme()
 * @return
 *  An array with the name of template file and variables
 */
function simple_faq_theme($existing, $type, $theme, $path) {
  return array(
    'faq_template' =&gt; array(
      'template' =&gt; 'simple_faq',
      'variables' =&gt; array('records' =&gt; array(), 'description' =&gt; ''),
    )
  );
}


Then when you call the theme function is where you send the actual values in, like this:

/**
 * FAQ Page content
 *
 * @return
 *  HTML created by template file
 */ 
 function simple_faq_page() {
   // Get faq content.
   // Categories, questions, answers.
   $records = get_faq_content();
   // faq description.
   $description = get_faq_info('intro');
   return theme('faq_template', array('records' =&gt; $records, 'description' =&gt; $description));
 }


As far as I know you can't give 2 values for the template file, however what you want to do should already be possible.
All you have to do is tell it where the original template file is in your module, then drupal will automatically find ones that are in any themes (the defining module doesn't have to set up anything for the theme).