You are here

class SlickViews in Slick Views 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/views/style/SlickViews.php \Drupal\slick_views\Plugin\views\style\SlickViews
  2. 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\style
View 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

Namesort descending Modifiers Type Description Overrides
SlickViews::buildOptionsForm public function Overrides parent::buildOptionsForm().
SlickViews::render public function Overrides StylePluginBase::render().
SlickViewsBase::$manager protected property The slick service manager.
SlickViewsBase::admin public function Returns the slick admin.
SlickViewsBase::buildElements public function Returns slick contents.
SlickViewsBase::buildSettings protected function
SlickViewsBase::buildSettingsForm protected function Build the Slick settings form.
SlickViewsBase::create public static function
SlickViewsBase::defineOptions protected function 1
SlickViewsBase::getDefinedFormScopes protected function Returns the defined scopes for the current form.
SlickViewsBase::manager public function Returns the slick manager.