Add an extra field to a content type display
Hook_node_view() can be used to add the block to the renderable $node->content array.
If the weight/order of the extra field needs to be set on the manage display tabs from your article content type, use hook_field_extra_fields() to tell Drupal about the new field.
/**
* Implements hook_field_extra_fields().
*/
function MYMODULE_field_extra_fields() {
$extra['node']['article'] = array (
'display' => array(
'extra_article_field' => array(
'label' => t('Extra article field'),
'description' => t('add an extra article field to the article content type.'),
'weight' => -99,
)
)
);
return $extra;
}
/**
* Implements hook_node_view().
*/
function MYMODULE_node_view($node, $view_mode, $langcode) {
switch($node->type) {
case 'article':
$node->content['extra_article_field'] = array('#markup' => 'Use a form or theme function here.');
break;
}
}