I created one custom module, it will create one custom block when it is installed. I want to display it on "product" content type only. Can I do the same with programmatically. It'll save my time. Here is my code.
<?php
function my_module_block_info() {
$blocks = array();
$blocks['my_module_config'] = array(
'info' => t('My Module'),
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function my_module_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'my_module_config':
$my_module_form = drupal_get_form('my_module_form');
$my_module_form = drupal_render($my_module_form);
$block['subject'] = '';
$block['content'] = $my_module_form;
break;
}
return $block;
}
?>