In browse.conf I have the following view set up:
timeline = {
data = ca_objects.mfa_object_date,
display = {
title_template = <l>^ca_objects.preferred_labels.name</l> (^ca_objects.idno),
description_template = <p>^ca_objects.description</p>,
credit_template = ^ca_objects.rightsStatement.rightsStatement_text,
caption_template = <em>^ca_objects.caption</em>,
image = ^ca_object_representations.media.small,
icon = ^ca_object_representations.media.icon
}
}
where ca_objects.mfa_object_date is the custom metadata element I use to date the object.
In front_page_html.php:
<?php
$va_access_values = $this->getVar("access_values");
AssetLoadManager::register('timeline');
?>
...
<div id="frontTimelineContainer">
<div id="timeline-embed"></div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
createStoryJS({
type: 'timeline',
width: '100%',
height: '600',
source: '<?php print caNavUrl($this->request, '', 'Front', 'timelinejson'); ?>',
embed_id: 'timeline-embed',
initial_zoom: '3',
font: 'medula-lato'
});
});
</script>
The timeline container shows an error from /assets/timelinejs/js/timeline-min.js
ERROR: TypeError: Cannot read properties of null (reading 'events')
Timeline configuration has no events
@monica For what you say, TimelineJS should almost work out of the box. What am I missing?
Another method would be to embed the timeline using Knight's <iframe> as explained in https://timeline.knightlab.com/#examples. This works fine, but not very convenient for databases being regularly updated. Would definitely prefer the timeline to read from the local database, no doubt.
Thanks.