tags:

views:

17

answers:

1

I have a simple module which will return a form , but now i have added this to a menu like admin/settings/ But i want this form in another page ,so i added a hook_block() , my module showed up in the blocks page and i added it to be seen by all in all pages in content area but i dont get that form ? where did i go wrong ? I am new to drupal any help plz

function emp_form_block($op = 'list', $delta = 0, $edit = array()) {
     switch ($op) {
          case 'list':
          $blocks[0]['info'] = t('New Block');
          $blocks[0]['cache'] = BLOCK_NO_CACHE;
          return $blocks;
     }
}

i am using drupal 6

A: 

You should also implement the view op, like this:

case 'view':
  return array(
    'subject' => t('My awesome form'),
    'content' => drupal_get_form('my_awesome_form'),
  );
  break;
Yorirou
ok i added that drupal_get_form('my module') but i got only the subject line but not the form, if i add a text as content i get it , but i am not able to display the form. I have added this hook_block() in the same module where i have the form . Should i have seperate modules ?
kantu
i found another way to display form . . . using node_load
kantu