Form and Textcontent in Block I'm having problems with adding a form and text-content into a block. To get both, form and text, into my block, I use render() on my form, but I read, this isn't the best way to do, but don't found another way. Anyone knows how to get both into the content without using render()?

function commerce_bulk_invoice_block_view($block_name = '') {
    $block = array();
    if ($block_name == 'showinvoiceoptions') {
        $block['content'] = '&lt;div id="invoice-block"&gt;';
        if(!isset($_SESSION['selected_entities'])) {
            $block['content'] .= 'select a product first';
        } else {
            $block['content'] .= '&lt;h1&gt;SESSION Variables:&lt;/h1&gt;';
            foreach($entity_array as $book) {               
                $block['content'] .= '&lt;pre&gt;';
                $block['content'] .= print_r( $book, true );
                $block['content'] .= '&lt;/pre&gt;';
            }
        }
        $block['content'] .= '&lt;/div&gt;';

        $form = drupal_get_form('commerce_bulk_invoice_form');
        $block['content'] .= render($form);
    }
    return $block;
}
Try the following code

function commerce_bulk_invoice_block_view($block_name = '') {
  $block = array();
  if ($block_name == 'showinvoiceoptions') {
    $content = '&lt;div id="invoice-block"&gt;';
    if(!isset($_SESSION['selected_entities'])) {
        $content .= 'select a product first';
    } else {
        $content .= '&lt;h1&gt;SESSION Variables:&lt;/h1&gt;';
        foreach($entity_array as $book) {               
            $content .= '&lt;pre&gt;';
            $content .= print_r( $book, true );
            $content .= '&lt;/pre&gt;';
        }
    }

    $content .= '&lt;/div&gt;';  

    $build['content']=array('#markup' =&gt; $content);
    $build['form']=drupal_get_form('commerce_bulk_invoice_form');

    $block['content'] = $build;
 }
 return $block;
}