Skip to content

Instantly share code, notes, and snippets.

@pasankg
Created August 16, 2020 13:25
Show Gist options
  • Save pasankg/e670e65885297fd42af5cb987324e66f to your computer and use it in GitHub Desktop.
Save pasankg/e670e65885297fd42af5cb987324e66f to your computer and use it in GitHub Desktop.
<?php
/**
* @file
* Definition of Drupal\my_style\Plugin\views\style\MyStyle.
*/
namespace Drupal\my_style\Plugin\views\style;
use Drupal\core\form\FormStateInterface;
use Drupal\views\Plugin\views\style\StylePluginBase;
/**
* Style plugin to render a list articles
* in special format.
*
* @ingroup views_style_plugins
*
* @ViewsStyle(
* id = "my_style_plugin",
* title = @Translation("Blog View Style"),
* help = @Translation("Render a list of articles in a special format."),
* theme = "my_style_template",
* display_types = { "normal" }
* )
*
*/
class MyStyle extends StylePluginBase {
/**
* {@inheritdoc}
*/
protected $usesRowPlugin = TRUE;
/**
* Set default options
*/
protected function defineOptions() {
$options = parent::defineOptions();
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
}
public function render() {
return parent::render();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment