hreffing from tooltips

wboykinm's Avatar

wboykinm

13 Dec, 2011 09:30 PM

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!

  1. Support Staff 2 Posted by Tom MacWright on 15 Dec, 2011 04:43 PM

    Tom MacWright's Avatar

    Hey,

    Yep, that should be the ticket. Without target="_blank", the link will open in the tooltip iframe itself.

  2. 3 Posted by wboykinm on 15 Dec, 2011 07:00 PM

    wboykinm's Avatar

    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.

  3. Support Staff 4 Posted by Will White on 15 Dec, 2011 08:38 PM

    Will White's Avatar

    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 _top or any named target (any word without the underscore).

  4. 5 Posted by wboykinm on 02 Jan, 2012 04:30 PM

    wboykinm's Avatar

    I think I got it. Thanks for the help!

  5. Will White closed this discussion on 02 Jan, 2012 04:58 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

25 May, 2013 08:01 PM
17 May, 2013 05:14 AM
25 May, 2013 06:04 PM
25 May, 2013 09:12 AM
25 May, 2013 08:30 AM