3

I am writing module for drupal 7. Module generates block and item list inside that block['content']. When i am using standard theme('item_list', array('items' => $items)) everything works, but when i want to define my own theme which will be used instead of item_list, block dissapears. I've been reading documentation and various examples, but nothing helped. In my module's file i wrote:

function lastposts_thm_theme() {
  return array(
   'lastposts_thm' => array(
   'variables' => array('items' => NULL),
   //template file, path, ....
   ),
 );
}
function theme_lastposts_thm($variables) {
  $node = $variables['items'];
  $build = node_view($node);
  $output = drupal_render($build);

  return $output;
}

And when i call it from block_view function, it doesn't work theme('lastposts_thm', $...). Where i am mistaking?

Ian J
  • 613
  • 1
  • 5
  • 6

1 Answers1

1

Check if your theme prints the variables for the blocks and has the region defined in the info field of your theme. That could be the issue you are facing. .

Binny K Thomas
  • 246
  • 1
  • 8