I am trying to use the hook_theme function to utilize some template files. I have the following function defined in my theme:
template.php
function my_name_theme($existing, $type, $theme, $path) {
return array(
'testy' => array(
'variables' => array('title' => NULL),
'template' => 'testy',
),
);
}
And I have the following template defined:
testy.tpl.php
<h1><?php print $title; ?></h1>
I have a content type called "Page" with a corresponding template:
node--page.tpl.php
<?php
print 'before theme call';
$variables = array();
$variables['title'] = 'my title';
print theme('testy', $variables);
print 'after theme call';
?>
When viewing one of my "Page" content types, the rendered page only shows the following, with no title:
before theme callafter theme call
I have cleared all caches. Why isn't this working?