You are here

protected function ContentBrowserPreview::defineOptions in Content Browser 8

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides FieldPluginBase::defineOptions

File

src/Plugin/views/field/ContentBrowserPreview.php, line 100

Class

ContentBrowserPreview
Defines a custom field that renders a preview of a Content Entity type, and allows for changing field settings with exposed input.

Namespace

Drupal\content_browser\Plugin\views\field

Code

protected function defineOptions() {
  $options = [];
  $options['view_mode'] = [
    'default' => 'teaser',
  ];
  $options['exposed_view_mode'] = [
    'default' => TRUE,
  ];
  return $options;
}