You are here

public function FlexSlider::render in Flex Slider 8.2

Render the display in this style.

Overrides StylePluginBase::render

File

flexslider_views/src/Plugin/views/style/FlexSlider.php, line 101

Class

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

Namespace

Drupal\flexslider_views\Plugin\views\style

Code

public function render() {

  // Group the rows according to the grouping field, if specified.
  $sets = parent::render();

  // Render each group separately and concatenate.
  $output = $sets;
  foreach ($sets as $key => &$set) {

    // Add caption field if chosen.
    if (!empty($this->options['captionfield'])) {
      $caption_field = $this->options['captionfield'];
      foreach ($set['#rows'] as $index => $row) {
        $set['#rows'][$index]['#caption'] = $this->rendered_fields[$index][$caption_field];
      }
    }
    $output[$key] = [
      '#theme' => $this
        ->themeFunctions(),
      '#view' => $this->view,
      '#options' => $this->options,
      '#rows' => $set['#rows'],
      '#title' => $set['#title'],
    ];
  }
  return $output;
}