You are here

README.txt in Extrafield Views Integration 7

Same filename and directory in other branches
  1. 8 README.txt
-- SUMMARY --

The Extrafield Views Integration Module enables all Drupal core extra fields in
the system from type "display" as fields in views. A special greeting to
Daniel Wehner, he gave me with his views training
(sponsored by comm-press GmbH) the knowledge to write this module.

-- REQUIREMENTS --

Views
Entity

 -- INSTALLATION --

For installing the module, just download the source code and enable the module.
That's all.

-- CONFIGURATION --

The module itself needs no configuration, because the extra fields that you
want to use need an callback key and a callback function. Every module can use
hook_field_extra_fields() to register the extra fields. Normally it looks like
this:

function hook_field_extra_fields() {
  $extra_fields = array(
    'entity_type' => array(
      'bundle' => array(
        'display' => array(
           'field_name' => array(
            'label' => 'field label',
            'description' => 'field description',
            'weight' => 0,
            'callback' => 'field_callback_function',
          ),
        ),
      ),
   ),
);

return $extra_fields;
}

function field_callback_function($entity) {
  return 'Field content to display in views or entity display';
}

The module needs both, the callback key and an existing callback function
defined in the callback key. The module only registers extra fields from type
"display" with the required key and the existing callback function. Views then
passes the entity to the callback function of the field.

-- FAQ --

Q:  I register an extra field for node type "article". But views doesn't show
    me the extra field.

A:  Ensure that you add the callback key to the extra field array and that the
    function you defined in the callback key exists.

Q:  I see my field for the node type "article" but I don't see any output.

A:  Ensure that your callback function returns a value.

File

README.txt
View source
  1. -- SUMMARY --
  2. The Extrafield Views Integration Module enables all Drupal core extra fields in
  3. the system from type "display" as fields in views. A special greeting to
  4. Daniel Wehner, he gave me with his views training
  5. (sponsored by comm-press GmbH) the knowledge to write this module.
  6. -- REQUIREMENTS --
  7. Views
  8. Entity
  9. -- INSTALLATION --
  10. For installing the module, just download the source code and enable the module.
  11. That's all.
  12. -- CONFIGURATION --
  13. The module itself needs no configuration, because the extra fields that you
  14. want to use need an callback key and a callback function. Every module can use
  15. hook_field_extra_fields() to register the extra fields. Normally it looks like
  16. this:
  17. function hook_field_extra_fields() {
  18. $extra_fields = array(
  19. 'entity_type' => array(
  20. 'bundle' => array(
  21. 'display' => array(
  22. 'field_name' => array(
  23. 'label' => 'field label',
  24. 'description' => 'field description',
  25. 'weight' => 0,
  26. 'callback' => 'field_callback_function',
  27. ),
  28. ),
  29. ),
  30. ),
  31. );
  32. return $extra_fields;
  33. }
  34. function field_callback_function($entity) {
  35. return 'Field content to display in views or entity display';
  36. }
  37. The module needs both, the callback key and an existing callback function
  38. defined in the callback key. The module only registers extra fields from type
  39. "display" with the required key and the existing callback function. Views then
  40. passes the entity to the callback function of the field.
  41. -- FAQ --
  42. Q: I register an extra field for node type "article". But views doesn't show
  43. me the extra field.
  44. A: Ensure that you add the callback key to the extra field array and that the
  45. function you defined in the callback key exists.
  46. Q: I see my field for the node type "article" but I don't see any output.
  47. A: Ensure that your callback function returns a value.