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?
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. .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With