4

Is it possible to include information about relations in the HTML popup in ArcMap?

I have two tables, one with points (Columns: ID, Name) and one with events about those points (Columns: PointID, Type, Year). The point table is related to the event table.

Now when I open an HTML popup there is no information about the relation in it. I would like it to display a list of all related events. For instance, with "Events" in the property name column and something like this in the value column:

  • 2005: Created
  • 2008: Rediscovered
  • 2014: Destroyed

Is this possible to do? Is it possible to do something similar (like linking to a HTML popup for the event)? How would I go about to accomplish this?

  • Is this question about linking the tables or display the information? – wittich Jun 29 '15 at 9:40
  • It's about displaying the information. Sorry for the lack of clarity. – Anders Jun 29 '15 at 10:02
  • Interesting question...this is not possible by simply using the HTML Pop up tab in Layer Properties. You can hyperlink to individual features. What you could do is create a duplicate point per event change and change the Layer Name and/or Display Name to incorporate the date and status. – spk578 Jun 29 '15 at 10:33
  • Thank you for the reply! It surely helps to know that it is not possible to do it the way I was planning (so I can stop trying...). I will look into your alternative. – Anders Jun 29 '15 at 10:45
  • I think the simplest way is to setup a little server script what returns the wanted information depending on the PointID. There are also some possibilities with XML. Check the standard XSL template... – wittich Jun 29 '15 at 12:26
2

Okay I tried a little bit more to use the XSL template. There are some ways to include information and displaying them depending on the PointID. Here a little example.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
    <xsl:variable name="ignoreFieldNames" select="'|OBJECTID|Shape|Shape_Length|Shape_Area|ATTACHMENTID|REL_OBJECTID|CONTENT_TYPE|ATT_NAME|DATA_SIZE|DATA|'"/>
    <xsl:variable name="headerRowColor" select="'#9CBCE2'"/>
    <xsl:variable name="alternateRowColor" select="'#D4E4F3'"/>
    <xsl:template match="/">
        <html>
            <head>
                <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
            </head>
            <body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;">
                <table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px">
                    <tr style="text-align:center;font-weight:bold;background:{$headerRowColor}">
                        <td style="font-size:16px;color:#ffffff;">
                            <xsl:text>PointID </xsl:text>
                            <xsl:value-of select="FieldsDoc/Title" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <xsl:choose>
                                <xsl:when test="FieldsDoc/Title = '1'">
                                    <xsl:text>Event details of event: </xsl:text>
                                    <xsl:value-of select="FieldsDoc/Title"/>
                                </xsl:when>
                                <xsl:when test="FieldsDoc/Title = '2'">
                                    <xsl:text>Event details of event: </xsl:text>
                                    <xsl:value-of select="FieldsDoc/Title"/>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:text>No event details available</xsl:text>
                                </xsl:otherwise>
                            </xsl:choose>
                        </td>
                    </tr>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

Hope that gives some ideas. There is also the XSL command <xsl:import href="file.xsl"/> but I'm not sure if ArcGIS supports that, at least I couldn't make it work.

I had also trouble to apply changes in the XSL stylesheet. There for I had to make the change, save and close the MXD project file and reopen the MXD file.

  • Great! This looks like the kind of thing I needed. – Anders Jul 1 '15 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.