This project is not covered by Drupal’s security advisory policy.

Developer API for generating and rendering data using the TimelineJS3 library.

E.g.


use Drupal\timelinejs_api\TimelineData;
use Drupal\timelinejs_api\TimelineSlide;
use Drupal\timelinejs_api\TimelineEra;
use Drupal\timelinejs_api\TimelineTitle;
use Drupal\timelinejs_api\Timelinerenderer;

$data = new TimelineData();

$date = TimelineDate::createFromDateString('now');
$text = new TimelineText('Headline text', 'Long text');
$event = new TimelineSlide($date, $text, 'My Group');

$data->addEvent($event);

// A URL to be AJAX loaded can also be passed instead of data object.
// The callback should return the same data as you'd get by calling
// TimelineData::toArray(). So data should be created in the same way
// and returned from the callback as JSON.
$renderer = new TimelineRenderer('unique-id', $data);

// Drupal render array with correct timeline JS data, #attached libraries, 
// and markup.
$build = $renderer->render();

Project information

Releases