Overview field

Component ID

2928735

Component name

Overview field

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

32

Component created

Component changed

Component body

Overview

Provides a custom field to add different predefined overviews.

This can be used to add views / blocks / ...

Usage

Add an option to the dropdown list:

/**
 * Implements hook_overview_field_options_alter().
 *
 * Add an option to the overview field.
 */
function overview_field_example_overview_field_options_alter(&$options) {
  $options['recent_content'] = t('Show a list of the recent content on the site');
}

Load the output for the previously declared option.


/**
 * Implements hook_overview_field_output_alter().
 */
function overview_field_example_overview_field_output_alter($key, &$output) {
  if ($key == 'recent_content') {
    $output = overview_field_load_view('content_recent', 'block_1');
  }
}

Roadmap

  • Add tests to the module.
  • Add extra options with Plugin derivatives instead of alters.