hreffing from tooltips
Just a quick one: what's the proper way to embed a clickable link in a tooltip from tilemill? Assuming for the sake of argument the field "link" in a rendered point layer contains a complete URL, would this (entered in the 'full' box) pull up a clickable link in an exported tooltip?
<strong>{{{location_title}}}</strong><br
/>
<a href="{{{link}}}"
target="_blank">{{{label}}}</a>
I ask because I haven't seen a lot of this yet; I'd like to know if there's any sort of best practice for using tooltips as portals to more in-depth information.
Thanks as always!
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Tom MacWright on 15 Dec, 2011 04:43 PM
Hey,
Yep, that should be the ticket. Without
target="_blank", the link will open in the tooltip iframe itself.3 Posted by wboykinm on 15 Dec, 2011 07:00 PM
Coolness. The links work great now, but for whatever reason removing target="_blank" doesn't cause the link to open in the resulting tooltip frame. Nor does including it cause the link to open in a new tab/window.
Is there a way to prevent tooltip-based links from navigating the browser away from the map page? I had hoped the target attribute would do it.
Support Staff 4 Posted by Will White on 15 Dec, 2011 08:38 PM
We have
<base target="_parent" />to iframe pages so that links don't ever open in the iframe container. This may be overriding your target setting unfortunately, but I'm not positive about the expected behavior. Try using_topor any named target (any word without the underscore).5 Posted by wboykinm on 02 Jan, 2012 04:30 PM
I think I got it. Thanks for the help!
Will White closed this discussion on 02 Jan, 2012 04:58 PM.