function noderelationships_field_info in Node Relationships 6
Implementation of hook_field_info().
Back reference fields:
- Are single-valued fields and cannot be shared (per type storage is a must). This is why these fields are created automatically. Note that these fields are hidden from the "Add new field" and "Add existing field" selectors in the "Manage fields" screen. See _noderelationships_cck_admin_forms_alter().
- Do not implement database columns and storage method is always per type. Hence, adding and removing back reference fields do not affect user data.
- Do not provide CCK to Views integration for back reference fields.
- Do not provide any widget in the node edit form.
- The widget is defined to manage its own multiple values, therefore these fields cannot be added to multigroups.
- Can be dragged from the "Manage fields" screen to any position in the node.
- The widget label can be changed at will from the "Manage fields" screen.
- The formatter simply renders a dynamically customized back reference view or the back references count.
File
- ./
noderelationships.module, line 159 - This is the main script for the noderelationships module. It merely contains the implementation of hooks invoked by Drupal core, CCK, Views, etc. All common functions are externalized into several scripts that are included on demand.
Code
function noderelationships_field_info() {
return array(
'noderelationships_backref' => array(
'label' => t('Back reference'),
'description' => t('Display node back references.'),
),
);
}