0

I created a custom tpl.php page with some basic HTML:

<div id='test'>TEST</div>

And a module file that defines the theme:

function my_module_test_theme($existing, $type, $theme, $path) {
    $items = array();

    //Test
    $items['test_test'] = array(
        'template' => 'test-test',
        'path' => drupal_get_path('module', 'my_module') . '/templates',
    );

    return $items;
}

But when I try to print it out in my theme it doesn't work:

<?php $output = theme('test_test'); ?>

Am I printing out the theme in my site's theme's page.tpl.php incorrectly?

1

I forgot to echo $output.........

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.