views:

40

answers:

1

I currently write a module that generates a block. The output should be defined by a template. Nothing special, yet the arguments don't seem to get passed properly.

This is the theme-method:

/* # Theme {{{*/
function browse_by_taxonomy_theme() {
  return array(
    'browse_by_taxonomy_block' => array(
      'template' => 'browse_by_taxonomy_block',
      'arguments' => array(
        'next' => null,
        'previous' => null,
        'term' => null,
        'hide_if_null' => variable_get('browse_by_taxonomy_hide_links', false)
      )
    )
  );
}/*}}}*/

And it's being called like that:

$block['content'] = theme('browse_by_taxonomy_block', "next", "previous", $tid);

Even when i put it to the minimum of this it does not work:

function browse_by_taxonomy_block($op = 'list', $delta = 0, $edit = array()) {  
  switch ($op) {
    case 'list':
      $block = array(array('info' => t("Browse by taxonomy")));
      return $block;

    case 'view':
      # […] Dragons be here
      return array(
        'subject' => null, 
        'content' => theme('browse_by_taxonomy_block', "next", "previous", "p")
      );
  }
}/*}}}*/

But in my template everything is null

var_dump($previous); # => NULL
var_dump($next); # => NULL
var_dump($hide_if_null); # => NULL
var_dump($term); # => NULL

In another module i wrote i did it pretty much the same way and it works. What am I doning wrong this time?

+1  A: 

Most likely the problem is caused by caching issues, as Drupal caches all theme info for performance reasons.

googletorp

related questions