I have created a content type in Drupal 7 using the following code.
function module_node_info() {
return array(
'module' => array(
'name' => t('module'),
'base' => 'module',
'module' => 'module',
'description' => t("You can add a content for module from here."),
),
);
}
This seems to be working fine: I see the content type and I can add fields. When I create fields for this content type through code, the fields show up when I click on 'add content' but they are not showing in my content type. When I add nodes of that specific content type, the nodes are not showing and the fields are empty when I edit them.
I miss something, but I have no idea what that could be. I use the following code to create the fields.
function module_form($node, &$form_state) {
$form = array();
$form['module_name'] = array(
'#type' => 'textfield',
'#title' => t('Enter the name of your module'),
'#required' => TRUE,
'#description' => t('This name will be visible on the website'),
);
return $form;
}