[Timeline] add url/a href event title

68 views
Skip to first unread message

Zulkifli Said

unread,
Jan 30, 2012, 3:40:23 AM1/30/12
to simile-...@googlegroups.com
i try to make an url event title in timeline. 
i add tag <a href="www.google.com"> </> in file jfk.xml. but it's not work.

this is my wrong code:

<event start="Fri Nov 22 1963 12:54:00 GMT-0600"
        title="<a href=www.google.com>Office Tippit calls HQ</a>"
        >
        Officer Tippit calls into HQ, and is asked if he is in Oakcliff 
        area. He replies, "Yes". 
        &lt;i&gt;ref. Rush to Judgement, p 194&lt;/i&gt;
        </event>


please give me a solution to add url in event title like picture below

Ryan Lee

unread,
Feb 14, 2012, 1:24:17 AM2/14/12
to simile-...@googlegroups.com
Hello,

This is described in the documentation:

https://code.google.com/p/simile-widgets/wiki/Timeline_EventSources

Under "Additional Event Attributes" there is a "link" attribute listed,
which is what you should use to add your URL to the event title.

Michael Nosal

unread,
Mar 20, 2012, 3:22:48 PM3/20/12
to simile-...@googlegroups.com
On Jan 30, 2012, at 3:40 AM, Zulkifli Said wrote:

> i try to make an url event title in timeline.
> i add tag <a href="www.google.com"> </> in file jfk.xml. but it's not work.
>
> this is my wrong code:
>
> <event start="Fri Nov 22 1963 12:54:00 GMT-0600"
> title="<a href=www.google.com>Office Tippit calls HQ</a>"
> >
> Officer Tippit calls into HQ, and is asked if he is in Oakcliff
> area. He replies, "Yes".
> &lt;i&gt;ref. Rush to Judgement, p 194&lt;/i&gt;
> </event>

You specify a 'link' attribute in your event:
<event start="1912' title="Portrait of Pablo Picasso" link="http://www.blahblah.com/pictures/picasso.jpg">

Note that you specify the link url, and not as HTML for an anchor element.

Timeline will automatically check for this and create the link as needed:
(From /api/scripts/sources.js, line 537:)
var divTitle = doc.createElement("div");
var textTitle = doc.createTextNode(title);
if (link != null) {
var a = doc.createElement("a");
a.href = link;
a.appendChild(textTitle);
divTitle.appendChild(a);
} else {
divTitle.appendChild(textTitle);
}

The info bubble will have the value for title as a hyperlink to the url you specify in the link attribute.

--Mike

Reply all
Reply to author
Forward
0 new messages