My goal is to render an array of values (body, date) using my own theming function. I've read Using the theme layer, and checked out the example modules, and I can't see the reason why this isn't outputting the test string.

I've implemented registered my theme hook:

function mymod_theme() {
    $items = array(
        'mymod_items' => array(
            'variables' => array(
    return $items;

I've implemented a theme function:

function theme_mymod_items($variables) {
    return 'I am themed output';

And I call this from my hook_block_view:

function mymod_block_view($delta = '') {
    switch($delta) {
        case 'mymod':
            $block['subject'] = t('My Module');
            $items = array(
            $block['content'] = theme('mymod_items',$items);
    return $block;

This results in the block not displaying, and the following message turning up in the log:

Theme key "mymod_items" not found.

Can someone please tell me what obviously essential step I've missed, or if I'm going in entirely the wrong direction?

1 Answer 1


It's an obvious answer, so sorry if you've tried it, but have you cleared your cache, specifically the theme registry?

  • 6
    Well, that was embarrassing. Dec 5, 2011 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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