1 views.api.php hook_views_preview_info_alter(&$rows, $view)

Alter the information box that (optionally) appears with a view preview, including query and performance statistics.

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. MODULENAME.views.inc 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.

Warning: $view is not a reference in PHP4 and cannot be modified here. But it IS a reference in PHP5, and can be modified. Please be careful with it.


$rows: An associative array with two keys:

  • query: An array of rows suitable for theme('table'), containing information about the query and the display title and path.
  • statistics: An array of rows suitable for theme('table'), containing performance statistics.

$view: The view object.

See also


Related topics


core/modules/views/views.api.php, line 910
Describe hooks provided by the Views module.


function hook_views_preview_info_alter(&$rows, $view) {
  // Adds information about the tables being queried by the view to the query
  // part of the info box.
  $rows['query'][] = array(
    t('<strong>Table queue</strong>'),
    count($view->query->table_queue) . ': (' . implode(', ', array_keys($view->query->table_queue)) . ')',