HTML popups: open links in "real" web browser?

4189
3
Jump to solution
02-18-2015 03:29 PM
PatrickAlexander2
New Contributor

Hello all,

 

I'm using ArcMap 10.1 in Windows 7 and have the following question: How do you open links contained in an HTML popup in a web browser?

 

E.g., suppose your html popup for a feature contains "<a href="http://google.com/">Google</a>". If you click the resulting link in ArcMap, it will open http://google.com in ArcMap's wimpy little built-in browser. I would much rather it open the URL in my default web browser, for instance in Internet Explorer. Is this possible? If so, how?

Reply
0 Kudos
1 Solution

Accepted Solutions
MarkBockenhauer
Esri Regular Contributor

You can use an attribute like this:

<a href="http://www.esri.com" target="_blank">http://www.esri.com</a>

Attached is a layer package that shows the various attribute and how they behave.

The XSL Template was modified in the

<xsl:template match="Field">     Section.

if you look at line 1 below it was modified to show attributes that start with HTML tags to display as HTML.

Defatault XSL template.

<xsl:when test="FieldValue[starts-with(., '&lt;img ')]">

  <xsl:value-of select="FieldValue" disable-output-escaping="yes" />

</xsl:when>

Modification to template.

<xsl:when test="FieldValue[starts-with(., '&lt;')]">

  <xsl:value-of select="FieldValue" disable-output-escaping="yes" />

  </xsl:when>

Mark

View solution in original post

Reply
0 Kudos
3 Replies
MarkBockenhauer
Esri Regular Contributor

You can use an attribute like this:

<a href="http://www.esri.com" target="_blank">http://www.esri.com</a>

Attached is a layer package that shows the various attribute and how they behave.

The XSL Template was modified in the

<xsl:template match="Field">     Section.

if you look at line 1 below it was modified to show attributes that start with HTML tags to display as HTML.

Defatault XSL template.

<xsl:when test="FieldValue[starts-with(., '&lt;img ')]">

  <xsl:value-of select="FieldValue" disable-output-escaping="yes" />

</xsl:when>

Modification to template.

<xsl:when test="FieldValue[starts-with(., '&lt;')]">

  <xsl:value-of select="FieldValue" disable-output-escaping="yes" />

  </xsl:when>

Mark

View solution in original post

Reply
0 Kudos
PatrickAlexander2
New Contributor

Excellent, thank you very much!

I'm still a bit baffled on one point though: why does the same html not have the same effect in the context of attachments? So far as I can tell, the default xsl creates a link for each attachment of the form "<a href="http://www.esri.com" target="_blank">http://www.esri.com</a>" (except, of course, that it would be pointing to a local file rather than to a website!) but does not open that link in a web browser window (it creates a new window of the built-in browser emulator). So sometimes ArcMap interprets 'target="_blank"' as meaning "send to Internet Explorer" and sometimes it doesn't?

Reply
0 Kudos
MarkBockenhauer
Esri Regular Contributor

Attachments are handled differently..  I think they are hard coded to display in the "ArcMap window"

Not the best experience, but if you hold down the control key and use the scroll wheel on the mouse, you can zoom in and out on the image displayed in the ArcMap popup window.   For image links in the popup window that are not attachments, using target="_blank" will launch your browser.

mark

Reply
0 Kudos