I'm struggling with blocks and a custom module. What I've got so far is a module which generates a block with that code:
function commerce_bulk_invoice_block_info() {
$blocks = array();
$blocks['showinvoiceoptions'] = array(
'info' => t('Define Invoice Options'),
);
return $blocks;
}
function commerce_bulk_invoice_block_view($block_name = '') {
if ($block_name == 'showinvoiceoptions') {
echo '<div id="invoice-block">';
if(!isset($_SESSION['selected_entities'])) {
echo 'select a product first';
} else {
echo '<h1>SESSION Variables:</h1>';
echo '<pre>';
print_r($_SESSION['selected_entities']);
echo '</pre>';
}
echo '</div>';
}
}
My problem is, the content generated by hook_block_view is not shown in the selected region but directly after the opening body tag. And it pulls the whole head-content into the body. Anyone knows a solution for that?