loading templates of region within page.tpl regardless of blocks being present I came to this query while trying to create my own theme. Say i have my region named footertop, which is placed above the footer. Its going to contain only some html content and some site logos which are static atleast for now.

I don't have any blocks to assign to this region but still want it to appear and had created a template file named block-footertop.tpl. But to my understanding (from drupal docs) this region only appears if any block is assigned to footer top region and is meant to be that way. My page.tpl.php doesn't have any conditions placed for this region, merely

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


I'd like to know if there's any way to 'include' the template within page.tpl.php like its done with smarty. Most of the search i'd done showed me results containing *hook_theme()* and seemed different than what I'm trying to achieve.

Why I'm trying to this is to save a big bunch of html markup from being in my page.tpl.php and sheer curiosity to understand drupal theming better.

Any suggestions/solutions to this novice drupal enthusiast would be greatly appreciated.

Thanks in advance!!
First of all I think you should be sure you know the difference between regions and template variables. Second, there are different approaches to your question:

A) Custom region + block

You could indeed define a new region. This can be done in one of the two ways:


in your theme's .info file (best way) like this regions[regionname] = Region name  
in the template.php file (haven't tried or felt the need to use this one)


After you defined your new region you can add blocks and content to it. You could just skip defining a new region and just add your block to the footer region or the region appropriate to your needs.

In your case your myTheme.info file would look something like this:

; $Id$
; @file: myTheme.info

regions[footertop] = Footer Top



output the region variable ($footertop)

/**
* @file page.tpl.php
* $footertop contains all the HTML content for that region
* and the blocks belonging to that region
*/
print $footertop;

.info file is cached in the database, so you need to clear the cache
add a new block: www.example.com/admin/build/block/add
add the block to the footertop region: www.example.com/admin/build/block/list/myTheme


When should you use this approach: when you have static content or/and just some snippets of text/html you want to add to your site. Remember to choose an appropriate input filter, otherwise some/all of your content might get filtered out.

Source: http://drupal.org/node/171224

B) Template variable

We want to define a new general variable available for all templates. Something like $content or $is_front. How do we do this: good old friend hook_theme :)

Create a new template file footertop.tpl.php and in it add the static data you want to add

/** 
* Implementation of hook_theme()
* @file template.php - in your active theme
*/
function myTheme_theme(&amp;$existing, $type, $theme, $path) {

  /*
  * If you are sub-theming another theme, like Zen,
  * you might need to do something like this
  * $hooks = zen_theme($existing, $type, $theme, $path);
  */ 

  $hooks['footertop'] = array(
    'template' =&gt; 'footertop',
    // 'arguments' =&gt; array(), // We could specify some arguments, useful when the content is not static
    // 'path' =&gt; $path . 'to/file' // This is also usefull if your template is in a subfolder
  );

  return $hooks;  
}

/**
* Now we make our variable available to other templates
* file template.php - in your active theme
*/
function myTheme_preprocess_page (&amp;$vars, $hook) {
  $vars['footertop'] = theme('footertop');
}


Now to add the variable in a template just do this:

/**
* @file e.g. page.tpl.php
*/

/* Some other code */

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

/* Other code */


Source:


http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_theme/6
http://drupal.org/theme-guide/6-7


Now if you want to be a pro with drupal theming or development you should get yourself a book on this matter. It helped me a lot when I was struggling to understand how Drupal theming works :) You'll defined find the right one for you.