Add custom field to Manage display for a entity

Public

Add Custom Field to Manage Display of a entity

</> CopyGet raw version
php
  1. function HOOK_field_extra_fields() {
  2. $extra['node']['article'] = array(
  3. 'display' => array(
  4. 'test_field' => array(
  5. 'label' => t('Test field'),
  6. 'description' => t('Test field'),
  7. 'weight' => 0,
  8. ),
  9. ),
  10. );
  11.  
  12. return $extra;
  13. }
  14.  
  15. function HOOK_node_view(&$vars) {
  16. $node->content['test_field'] = array(
  17. '#markup' => t('Test field'),
  18. '#weight' => 10,
  19. );
  20. }

Comments