protected function Comment::default_display_options in Views (for Drupal 7) 8.3
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
Overrides WizardPluginBase::default_display_options
File
- lib/
Views/ comment/ Plugin/ views/ wizard/ Comment.php, line 139 - Definition of Views\node\Plugin\views\wizard\Comment.
Class
- Comment
- Tests creating comment views with the wizard.
Namespace
Views\comment\Plugin\views\wizardCode
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
// Add a relationship to nodes.
$display_options['relationships']['nid']['id'] = 'nid';
$display_options['relationships']['nid']['table'] = 'comment';
$display_options['relationships']['nid']['field'] = 'nid';
$display_options['relationships']['nid']['required'] = 1;
// Remove the default fields, since we are customizing them here.
unset($display_options['fields']);
/* Field: Comment: Title */
$display_options['fields']['subject']['id'] = 'subject';
$display_options['fields']['subject']['table'] = 'comment';
$display_options['fields']['subject']['field'] = 'subject';
$display_options['fields']['subject']['label'] = '';
$display_options['fields']['subject']['alter']['alter_text'] = 0;
$display_options['fields']['subject']['alter']['make_link'] = 0;
$display_options['fields']['subject']['alter']['absolute'] = 0;
$display_options['fields']['subject']['alter']['trim'] = 0;
$display_options['fields']['subject']['alter']['word_boundary'] = 0;
$display_options['fields']['subject']['alter']['ellipsis'] = 0;
$display_options['fields']['subject']['alter']['strip_tags'] = 0;
$display_options['fields']['subject']['alter']['html'] = 0;
$display_options['fields']['subject']['hide_empty'] = 0;
$display_options['fields']['subject']['empty_zero'] = 0;
$display_options['fields']['subject']['link_to_comment'] = 1;
return $display_options;
}