New Timeline module
I have been playing with the Timeline project from simile.mit.edu.
http://simile.mit.edu/timeline/
The Timeline project delivers a scrollable, DHTML timeline which is analogous to the Google Maps interface (as seen in GMap module) except this shows a timeline of nodes. This project is new and under active development, but working mostly.
The attached module requires views module. It provides 2 views plugins: Timeline Horizontal (works) and Timeline Vertical (does not work due to bug in Timeline project). It also provides the beginnings of an API of sorts, where you can programmatically make timelines. E.g. this function
/**
*
* Returns the html required to insert a timeline.
*
* @param $timeline
* An associative array with the following variables set:
*
* id - the id of the timeline element
* width - width of the map
* height - height of the map
* class - CSS class of the div enclosing the timeline (default 'tline')
* align - left right or center (default '')
* orientation - HORIZONTAL or VERTICAL
* start_date - the start date of the timeline
* timezone - the timezone represented by # of hours difference from GMT
* view_name - the name of the Drupal view to render in the timeline
* view_args - an array of view arguments
*
* @return
* A string containing the timeline HTML.
*
*/
function timeline_draw_timeline($timeline) {This is a basic implementation of the timeline project. More styling and other graphical elements could be enabled.
A few bugs in the Timeline project: events show in HORIZONTAL mode only (not vertical).
Any suggestions how I should release this? As a views-centered contribution (e.g. views bonus pack)? Fixes, contributions welcome.
Note you will have to rename the attached file to
timeline.module
** New update 2006/08/07 **
I added a fix or 2, and this now supports plotting nodes using any date field. It uses the views fields to determine which field to use for plotting the node on the timeline. If a views field has been specified, then the 1st field is assumed to be the start time for the node on the timeline. If a second field has been added to the view, then it assumes this will represent the end time for the node on the timeline. It ignores any other views fields.
I would appreciate any suggestion of a less quirky way to specify in the views UI which field should be used for a node's start date/time and (optionally) end date/time.
The module now provides 2 views:
timeline_nodes - plots nodes by created date
timeline_events - plots nodes by event start and end date [requires event module]
Note that the module reads the # of nodes to display from the views UI & module, which for some reason restricts views to 99 results or less. I could make the module just show all nodes.
| Attachment | Size |
|---|---|
| timeline_module2.txt | 19.6 KB |

i should mention a few more details
(1) This module also provides an example view
timeline_future_events
which shows all future events. You can modify the start date using args YYYY/MM/DD
(2) When creating views using the timeline plugin,
(a) use only Timeline Horizontal since vertical timelines
(b) Like "Teaser" view type, it does not use fields in current implementation. Rather, it uses node teaser as the description field
more details
(3) This module loads the JS library from
http://simile.mit.edu/timeline/api/timeline-api.js
, so when that website is down (as it is at this writing) then the timeline will be down. As Timeline project stabilizes, I would import a stable version into the code of this module
(4) Display issue: timeline dates insist on reporting "GMT" timezone regardless of timezone
(5) Display of multiline titles on the timeline has ungraceful appearance
Hmmm!
Is it possible for the view to show items with a time span AND items with a single fixed 'event date' in the same view?
yes
the module looks at each node and uses the first field added to the view to be the start date. If a 2nd field has been added to the view, then it uses that field to represent an end date. On a node-by-node basis, if it finds a single start date then it only shows a fixed event date (a dot on the timeline). for nodes that have an event date, then a range is shown.
in practice, i find that most events have a start date & end date (or does the module always add an end date?).
cool - ?
nice ... what are you using for dates. are you assuming event.module nodes here? this might be generallly useful by plotting on node created date as well. or even an arbitrary cck date field. perhaps the plugin could be flexible on which date to plot upon.
yes, currently requires
yes, currently requires event module and views module. good call w/ adding support for node created dates etc. quite doable. will get on it.
I know another timeline module in development
With a different approach, I believe.
I'll point him at this discussion -- it should get created as a project on Drupal.org.
Follow-up to this
In case anyone was wondering, we ended up merging the two timeline projects as documented in #90272.
Release 4.7.x-1.0 now available
After several months of development, version 1.0 of the Timeline module for Drupal 4.7 is now available.