function hook_views_data_alter


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 views.api.php hook_views_data_alter(&$data)
cle7 views.api.php hook_views_data_alter(&$data)
elmsmedia7 views.api.php hook_views_data_alter(&$data)
icor7 views.api.php hook_views_data_alter(&$data)
meedjum_blog7 views.api.php hook_views_data_alter(&$data)
mooc7 views.api.php hook_views_data_alter(&$data)

Alter table structure.

You can add/edit/remove existing tables defined by hook_views_data().

This hook should be placed in and it will be auto-loaded. must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified.


$data: An array of all Views data, passed by reference. See hook_views_data() for structure.

See also


Related topics

29 functions implement hook_views_data_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

accessibility_reporting_views_data_alter in sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/views/
Implements hook_views_data_alter().
clone_views_data_alter in sites/all/modules/ulmus/node_clone/views/
Implements hook_views_data_alter()
comment_views_data_alter in sites/all/modules/ulmus/views/modules/
Use views_data_alter to add items to the node table that are relevant to comments.
contact_views_data_alter in sites/all/modules/ulmus/views/modules/
Implements hook_views_data_alter().
data_entity_views_data_alter in sites/all/modules/local_contrib/data/data_entity/views/
Implements hook_views_data_alter().

... See full list

1 invocation of hook_views_data_alter()
_views_fetch_data_build in sites/all/modules/ulmus/views/includes/
Build and set the views data cache if empty.


sites/all/modules/ulmus/views/views.api.php, line 477
Describe hooks provided by the Views module.


function hook_views_data_alter(&$data) {
  // This example alters the title of the node:nid field in the Views UI.
  $data['node']['nid']['title'] = t('Node-Nid');

  // This example adds an example field to the users table.
  $data['users']['example_field'] = array(
    'title' => t('Example field'),
    'help' => t('Some example content that references a user'),
    'field' => array(
      'handler' => 'modulename_handler_field_example_field',

  // This example changes the handler of the node title field.
  // In this handler you could do stuff, like preview of the node when clicking
  // the node title.
  $data['node']['title']['field']['handler'] = 'modulename_handler_field_node_title';

  // This example adds a relationship to table {foo}, so that 'foo' views can
  // add this table using a relationship. Because we don't want to write over
  // the primary key field definition for the {foo}.fid field, we use a dummy
  // field name as the key.
  $data['foo']['dummy_name'] = array(
    'title' => t('Example relationship'),
    'help' => t('Example help'),
    'relationship' => array(
      'base' => 'example_table', // Table we're joining to.
      'base field' => 'eid', // Field on the joined table.
      'field' => 'fid', // Real field name on the 'foo' table.
      'handler' => 'views_handler_relationship',
      'label' => t('Default label for relationship'),
      'title' => t('Title seen when adding relationship'),
      'help' => t('More information about relationship.'),

  // Note that the $data array is not returned – it is modified by reference.



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.