You are here

protected function Gridstack::defineOptions in DXPR GridStack 8

Same name in this branch
  1. 8 src/Plugin/views/style/Gridstack.php \Drupal\dxpr_gridstack\Plugin\views\style\Gridstack::defineOptions()
  2. 8 src/Plugin/views/row/Gridstack.php \Drupal\dxpr_gridstack\Plugin\views\row\Gridstack::defineOptions()
Same name and namespace in other branches
  1. 1.0.x src/Plugin/views/style/Gridstack.php \Drupal\dxpr_gridstack\Plugin\views\style\Gridstack::defineOptions()

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 StylePluginBase::defineOptions

File

src/Plugin/views/style/Gridstack.php, line 31

Class

Gridstack
Style plugin to render each item in an ordered or unordered list.

Namespace

Drupal\dxpr_gridstack\Plugin\views\style

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['gridstack_layout'] = [
    'default' => 'custom',
  ];
  $options['gridstack_items'] = [
    'default' => '3',
  ];
  $options['gridstack_gap'] = [
    'default' => '0',
  ];
  $options['gridstack_overlay'] = [
    'default' => 'dark',
  ];
  $options['gridstack_zoom'] = [
    'default' => 1,
  ];
  $options['gridstack_layout_data']['default'] = '[{"x":0,"y":0,"width":6,"height":6},{"x":6,"y":0,"width":3,"height":6},{"x":9,"y":0,"width":3,"height":6}]';
  $options['gridstack_items_mobile'] = [
    'default' => 1,
  ];
  return $options;
}