class SlickViews in Slick Views 8.2
Same name and namespace in other branches
- 8 src/Plugin/views/style/SlickViews.php \Drupal\slick_views\Plugin\views\style\SlickViews
- 7.3 src/Plugin/views/style/SlickViews.php \Drupal\slick_views\Plugin\views\style\SlickViews
Slick style plugin.
Plugin annotation
@ViewsStyle(
id = "slick",
title = @Translation("Slick Carousel"),
help = @Translation("Display the results in a Slick Carousel."),
theme = "slick_wrapper",
register_theme = FALSE,
display_types = {"normal"}
)
Hierarchy
- class \Drupal\slick_views\Plugin\views\style\SlickViewsBase extends \Drupal\blazy\Dejavu\BlazyStylePluginBase
- class \Drupal\slick_views\Plugin\views\style\SlickViews
Expanded class hierarchy of SlickViews
File
- src/
Plugin/ views/ style/ SlickViews.php, line 21
Namespace
Drupal\slick_views\Plugin\views\styleView source
class SlickViews extends SlickViewsBase {
/**
* Overrides parent::buildOptionsForm().
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$definition = $this
->getDefinedFormScopes();
$this
->buildSettingsForm($form, $definition);
}
/**
* Overrides StylePluginBase::render().
*/
public function render() {
$settings = $this
->buildSettings();
$elements = [];
foreach ($this
->renderGrouping($this->view->result, $settings['grouping']) as $rows) {
$build = $this
->buildElements($settings, $rows);
// Extracts Blazy formatter settings if available.
if (empty($settings['vanilla']) && isset($build['items'][0])) {
$this
->blazyManager()
->isBlazy($settings, $build['items'][0]);
}
// Supports Blazy multi-breakpoint images if using Blazy formatter.
$settings['first_image'] = isset($rows[0]) ? $this
->getFirstImage($rows[0]) : [];
$build['settings'] = $settings;
$elements = $this->manager
->build($build);
unset($build);
}
return $elements;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SlickViews:: |
public | function | Overrides parent::buildOptionsForm(). | |
SlickViews:: |
public | function | Overrides StylePluginBase::render(). | |
SlickViewsBase:: |
protected | property | The slick service manager. | |
SlickViewsBase:: |
public | function | Returns the slick admin. | |
SlickViewsBase:: |
public | function | Returns slick contents. | |
SlickViewsBase:: |
protected | function | ||
SlickViewsBase:: |
protected | function | Build the Slick settings form. | |
SlickViewsBase:: |
public static | function | ||
SlickViewsBase:: |
protected | function | 1 | |
SlickViewsBase:: |
protected | function | Returns the defined scopes for the current form. | |
SlickViewsBase:: |
public | function | Returns the slick manager. |