Get an Error with rendered page content in custom template file The code below works, but when I try to add the line  in my MYMODULE-page.tpl.php the content is rendered twice with some errors. For example the $title is printed, but i get an error message that the $title is not set and when I add some test text in the template file i get it also twice. I didn`t find any solution for this.

**** EDIT ****

function MYMODULE_theme() {
  return array(
    'page-MYMODULE' =&gt; array (
      'path' =&gt; drupal_get_path('module', 'MYMODULE') . '/templates',
      'template' =&gt; 'page-MYMODULE',
      'render element' =&gt; 'page',
    ),
    'content-MYMODULE' =&gt; array (
      'path' =&gt; drupal_get_path('module', 'MYMODULE') . '/templates',
      'template' =&gt; 'content-MYMODULE',
      'render element' =&gt; 'page',
      'variables' =&gt; array (
        'title' =&gt; NULL,
        'path' =&gt; NULL,
      ),
    ),
  );
}

function MYMODULE_preprocess_page(&amp;$variables, $hook) {  
  if (arg(0) == 'MYMODULE') {
    $variables['theme_hook_suggestions'][] = 'page-MYMODULE'; //underscores doesn't work for me
  };
}

function MYMODULE_menu() {
  $items = array(
    'MYMODULE' =&gt; array(
      'title' =&gt; 'Page Title',   // -&gt; page-MYMODULE.tpl.php
      'page callback' =&gt; 'MYMODULE_page_main',
      'access callback' =&gt; TRUE,
      'type' =&gt; MENU_CALLBACK,
    ),
  );
  return $items;
}

function MYMODULE_page_main() {
  $path = drupal_get_path("module", "MYMODULE");
  $page = array();

  $page['MYMODULE'] array(
    '#theme' =&gt; 'page-MYMODULE',
    '#path' =&gt; '$path',
    '#title' =&gt; 'Content Title',  // -&gt; content-MYMODULE.tpl.php
    '#attached' =&gt; array (
      'css' =&gt; array (
      'type' =&gt; 'file',
      'data' =&gt; $module_path.'/css/layout.css', //works only if layout.css was disable by hook_css_alter()
      'weight' =&gt; 'CSS_THEME',
     ),
  );
  return $page;
}

function MYMODULE_css_alter(&amp;$css){
  if (arg(0) == 'MYMODULE') {
    foreach($css as $key =&gt; $val){
      if ($val['group'] == '100') {
        unset($css[$key]);
      };
    };
  }
}


page-MYMODULE.tpl.php

&lt;?php print $title; ?&gt;

&lt;div id="content"&gt;
  &lt;?php print render($page['content']); ?&gt;
&lt;/div&gt;


content-MYMODULE.tpl.php

&lt;?php print $title; ?&gt;
&lt;?php print $path; ?&gt;
You haven't passed a variable named $title to the template, so one won't be available.

To do so, add variables to your hook_theme implementation:

function MYMODULE_theme() {
  return array(
    'MYMODULE-page' =&gt; array(
      'path' =&gt; drupal_get_path('module', 'MYMODULE') . '/templates',
      'template' =&gt; 'MYMODULE-page',
      'render element' =&gt; 'page',
      'variables' =&gt; array('title' =&gt; ''),
      ),
    ),
  );
}


and in your page callback:

return array(
  '#theme' =&gt; 'MYMODULE-page',
  '#title' =&gt; 'Title here',
);