I wanted to embed a SIMILE Timeline into a Wordpress posting, and it took longer than I expected to find a convenient way to do this without editing templates and such. There’s a nice plugin that does timelines for postings (WP SIMILE Timeline), but it doesn’t work for arbitrary timelines unconnected with the content of the blog itself. So, here’s a summary of a quick solution.
Those links will end up in the head for this posting.
For convenience, I uploaded the js and xml as media files in the
Wordpress dashboard; but it threw an error when it tried to save the
xml, so I uploaded that manually. I use the year/month directory
structure for my uploads (Settings / Miscellaneous / “Organize my
uploads into month- and year-based folders”), so the uploaded timeline
files end up in
onResize, as in
the Timeline examples. To get those to fire at the appropriate times,
Adding those two lines was the only change I had to make to the SIMILE sample code.
Finally, the posting itself needs a div with the appropriate id:
And that’s it. Here’s a demo, using the “Life of Monet” example from the SIMILE Timeline site.
[Demo removed after migrating this blog to Jekyll, 2017.]