As the title reads, I'm attempting to add a custom made module (simple contact form) into a region on my front page (this may be used other places as well, but for not just the front page). Could some one lend me their eyes/advice on how to do this correctly. The region on my page is labeled sidebar_first. I have attempted to add it via a hook_block_view() functionallity, however nothing seems to be taking.
.module
function honey_front_page_form_menu(){
global $user;
//Main Page Call Back
$items['front_page_form'] = array(
'page callback' =>'_honey_front_page_init',
'access arguments' => array('access content'),
'title' => t('Honey Contact page Form'),
);
}
function honey_front_page_form_admin_form(){
$form['front_form'] = array(
'#type' => 'fieldset',
'#title' => t('Admin Menu'),
);
$form['front_form']['name'] = array(
'#type' => 'textfield',
'#attributes' => array('placeholder' => t('name')),
'#required' => TRUE,
);
$form['front_form']['email'] = array(
'#type' => 'textfield',
'#attributes' => array('placeholder' => t('email')),
'#required' => TRUE,
);
$form['front_form']['phone'] = array(
'#type' => 'textfield',
'#attributes' => array('placeholder' => t('phone')),
'#required' => TRUE,
'#maxlength' => 15
);
$form['front_form']['comments'] = array(
'#type' => 'textfield',
'#attributes' => array('placeholder' => t('comments')),
'#required' => FALSE,
);
$form['front_form']['submit'] = array(
'#type' => 'submit',
'#value' => 'SUBMIT NOW',
'#field_prefix' => '<h3>',
'#field_suffix'=> '</h3>'
);
}
function honey_front_page_form_block_view($delta = ''){
//ensures form is only called on the front page.
// if (!drupal_is_front_page()){
// return NULL;
// }
if($delta == '1'){
$form = drupal_render( drupal_get_form('honey_front_page_form_admin_form'));
$block = array(
// 'subject' => t('Subject'),
'content' => $form,
);
return $block;
}
}