protected function views_timelinejs_plugin_style_timelinejs::build_slide in Views TimelineJS integration 7.3
Builds a timeline slide from the current views data row.
Return value
TimelineSlideInterface|NULL A slide object or NULL if the start date could not be parsed.
1 call to views_timelinejs_plugin_style_timelinejs::build_slide()
- views_timelinejs_plugin_style_timelinejs::render in ./
views_timelinejs_plugin_style_timelinejs.inc - Render the display in this style.
File
- ./
views_timelinejs_plugin_style_timelinejs.inc, line 388
Class
- views_timelinejs_plugin_style_timelinejs
- Style plugin to render items as TimelineJS3 slides.
Code
protected function build_slide() {
$start_date = $this
->build_date($this->options['timeline_fields']['start_date']);
// Return NULL if the slide has no start date.
if (empty($start_date)) {
return NULL;
}
$end_date = $this
->build_date($this->options['timeline_fields']['end_date']);
$text = $this
->build_text();
$slide = new TimelineSlide($start_date, $end_date, $text);
// Check to see if this slide should be the start slide.
$this
->check_start_slide($start_date);
$slide
->setDisplayDate($this
->build_display_date());
$slide
->setGroup($this
->build_group());
$slide
->setBackground($this
->build_background());
$media = $this
->build_media();
if (!empty($media)) {
$slide
->setMedia($media);
}
$slide
->setUniqueId($this
->build_unique_id());
return $slide;
}