<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>I believe the Example module includes a complete example of the block stuff.</span></div><div><span>You will also need hook_block_info() (</span><a href="http://api.drupal.org/api/drupal/modules--block--block.api.php/function/hook_block_info/7">http://api.drupal.org/api/drupal/modules--block--block.api.php/function/hook_block_info/7</a><span>) in order for the blocks to show up in the blocks list. Then your hook_block_view() (</span><a href="http://api.drupal.org/api/drupal/modules--block--block.api.php/function/hook_block_view/7">http://api.drupal.org/api/drupal/modules--block--block.api.php/function/hook_block_view/7</a><span>) will work to generate it.</span></div><div><br><span></span></div><div><span>You might also be interested in </span><a
 href="http://drupal.org/coding-standards">http://drupal.org/coding-standards</a></div><div>&nbsp;</div><div><font color="#ff007f" face="bookman old style, new york, times, serif" size="4"><i><b>Nancy</b></i></font></div><div><font color="#ff007f" face="bookman old style, new york, times, serif" size="4"><i><b></b></i></font><font color="#ff007f" face="bookman old style, new york, times, serif" size="4"><i><b></b></i></font> <br></div><div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Iain William Wiseman
 &lt;iwiseman@bibble.co.nz&gt;<br><b><span style="font-weight: bold;">To:</span></b> support@drupal.org<br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, October 5, 2011 3:51 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [support] Forms in blocks<br></font><br>
<div id="yiv1918322920">
  

    
  
  
    On 6/10/2011 2:28 a.m., Ms. Nancy Wichmann wrote:
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:12pt;">
        <div><span>"Created all my forms..." How did you create them? If
            they are in a module, why not add a simple hook_block() [or
            the D7 equivalents]? It looks like the formblock module
            probably does that with some fancy wrapping stuff.<br>
          </span></div>
        <div>&nbsp;</div>
        <div><font color="#ff007f" face="bookman old style, new york,
            times, serif" size="4"><i><b>Nancy</b></i></font></div>
        &nbsp;
        <div><font face="arial, helvetica, sans-serif">Injustice
            anywhere is a threat to justice everywhere. -- Dr. Martin L.
            King, Jr.</font></div>
        <br>
      </div>
    </blockquote>
    Thanks Nancy,<br>
    <br>
    They are in a module. I googled for some time and came across <br>
    <br>
http://stackoverflow.com/questions/1450941/inserting-a-form-into-a-block-in-drupal<br>
    <br>
    Which suggested<br>
    <br>
    function yourmodule_block_view($delta='')<br>
    {<br>
    &nbsp; switch($delta) {<br>
    &nbsp;&nbsp;&nbsp; case 'your_block_name':<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $block['subject'] = null; // Most forms don't have a subject <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $block['content'] =
    drupal_get_form('yourmodule_form_function');<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
    &nbsp;&nbsp; }<br>
    &nbsp;&nbsp; return $block;<br>
    &nbsp;}<br>
    <br>
    However I have done that for one of my simple forms and cannot see
    it appear under block. <br>
    <br>
    Assume I am an idiot when replying because it might be me being
    really silly. <span class="yiv1918322920moz-smiley-s1"><span> :-) </span></span><br>
    <br>
    Thanks as always for your help. I have come a long way over the last
    six months thanks to the support of this forum.<br>
    <br>
    Iain<br>
  

</div><br>-- <br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br><br></div></div></blockquote></div></div></body></html>