Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Widgets /

Discuss SilverStripe Widgets.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Smile Timeline for Silverstripe!?


Go to End


2 Posts   2490 Views

Avatar
Noki

Community Member, 6 Posts

9 June 2012 at 10:38am

Hey,
i try to integrate the Smile Timeline to Silverstripe. (http://www.simile-widgets.org/timeline/)
Usually the data for the Timeline comes from a XML or JSON File, but i would like to get them from the Database.

I created a TimelineEventPage where the user can add some events. But how can I read and use the Data for the Timeline in the java script?

The following code is loading the "timeline.xml" file with the event-data. how should I change the code to get the data from silverstripe?

<script ....

. . .
tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
tl.loadJSON("timeline.xml?"+ (new Date().getTime()), function(json, url) {
eventSource.loadJSON(json, url);

</script>

The XML-file:

<data
wiki-url="http://simile.mit.edu/shelf/"
wiki-section="Simile JFK Timeline">
<event
start="Sat May 20 1961 00:00:00 GMT-0600"
title="'Bay of Pigs' Invasion">
</event>
<event
start="Wed May 01 1963 00:00:00 GMT-0600"
end="Sat Jun 01 1963 00:00:00 GMT-0600"
isDuration="true"
title="Oswald moves to New Orleans">
Oswald moves to New Orleans, and finds employment at the William <!-- The event's description -->
B. Riley Coffee Company. &lt;i&gt;ref. Treachery in Dallas, p 320&lt;/i&gt;
</event>
<event>
...
</event>
</data>

Can anybody help?

Thanks Ben

Avatar
swaiba

Forum Moderator, 1899 Posts

15 February 2013 at 3:28am

Probably not of interest to you now Noki, but for future reference there is an SS module for timeline...

https://github.com/luisdias/Timeline-Silverstripe-Module