I read this answer, but I can not figure out, why my block is not shown. My block is activated in footer and should appear on <front>
.
/**
* Implements hook_theme().
*/
function poll_dialog_theme() {
return array(
'poll_dialog_output' => array(
'variables' => array(
'title' => NULL,
'content' => NULL,
'popular_content' => NULL,
),
'template' => 'theme/poll_dialog',
),
);
}
function poll_dialog_block_info() {
$blocks['poll_dialog'] = array(
'info' => t('Poll Dialog'),
'cache' => DRUPAL_NO_CACHE, //there are a number of caching options for this
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function poll_dialog_block_view($delta = '') {
switch ($delta) {
case 'poll_dialog':
$block['subject'] = t('poll_dialog');
$block['content'] = _poll_dialog_block_content();
break;
}
return $block;
}
/**
* Callback implemented by hook_block_view().
*/
function _poll_dialog_block_content() {
$static_title = t('Static Title');
$static_content = 'static content';
return theme('poll_dialog', array(
'title' => $static_title,
'content' => $static_content,
'link' => l('Poll', 'some url'), array('attributes' => array('target' => '_blank'))),
)
);
}