HTML popup - unable to format

5611
6
Jump to solution
01-22-2015 09:08 AM
TijmLanjouw
New Contributor II

Hi, I have some problems with formatting HTML popups. I don't seem to be able to change anything about the way a HTML popup window is formatted. When I load one of ESRIs XSL templates the first time, the popup changes to the new style. But when I want to adjust anything or just change the style by loading a new template, nothing works! Everything remains the same format.

On top of that, I'd like to display HTML formatting that is in one of the fields, but it shows me the code, not the formatted text.

 

I have arcgis 10.2. Basic setup: a shapefile, joined to a table originally from an access database. All together in a file geodatabase.

 

I have several years of experience with ArcGIS but never looked into the HTML popup function before, so I may be overseeing something very elementary. But to me it has a buggy feel to it.

1 Solution

Accepted Solutions
MarkBockenhauer
Esri Regular Contributor

Tijm,

It looks like the temporary content is not being cleared when modifying the HTML Popup XSL template.

I add a Point a layer,  the default popup looks like this.

defaultpopup.png

I decided to modify it so that the photo would show the picture, instead of the URL hyperlink.

In layer properties - html popup I modified the section of the XSL, for when a field value startes with "https:"

Changing it to show an image instead...

whenstartshttps.png

I clicked OK

Clicked on my feature to see the popup.

mistypedxsl.png

whoops ...  forgot to close the "img"

Back in Layer Properties make the correction.

correctlayerproperties.png

OK.. and Click the feature again.

mistypedxsl.png

hmm... same error.. what ??

The property seems to be stuck with my first XSL modification attempt.  I found that if I copy the layer in the TOC, and Paste it back in, If I click on the Feature from the pasted layer, I see the modification.

pastedlayershowsupdatedproperty.pngCraig Williams

Copy and paste seems to be a decent workaround for this issue.

The layer package for content used in this explanation is located at http://www.arcgis.com/home/item.html?id=5cb6af18edfb415499707d368c7388fc


Mark

View solution in original post

6 Replies
MarkBockenhauer
Esri Regular Contributor

Tijm,

It looks like the temporary content is not being cleared when modifying the HTML Popup XSL template.

I add a Point a layer,  the default popup looks like this.

defaultpopup.png

I decided to modify it so that the photo would show the picture, instead of the URL hyperlink.

In layer properties - html popup I modified the section of the XSL, for when a field value startes with "https:"

Changing it to show an image instead...

whenstartshttps.png

I clicked OK

Clicked on my feature to see the popup.

mistypedxsl.png

whoops ...  forgot to close the "img"

Back in Layer Properties make the correction.

correctlayerproperties.png

OK.. and Click the feature again.

mistypedxsl.png

hmm... same error.. what ??

The property seems to be stuck with my first XSL modification attempt.  I found that if I copy the layer in the TOC, and Paste it back in, If I click on the Feature from the pasted layer, I see the modification.

pastedlayershowsupdatedproperty.pngCraig Williams

Copy and paste seems to be a decent workaround for this issue.

The layer package for content used in this explanation is located at http://www.arcgis.com/home/item.html?id=5cb6af18edfb415499707d368c7388fc


Mark

TijmLanjouw
New Contributor II

Thanks for solving the main issue. Now, I still have another problem which can be attributed to my lack of knowledge of XSL:

So, one of my fields is a 'rich text' field in access, so it contains formatting. As you can see below, the html that is contained by this field is not parsed in the popup. How do I do this with XSL?

HTML popup.JPG

0 Kudos
MarkBockenhauer
Esri Regular Contributor

One way you could do this..  modify this line in the default XSL.

outescape.png

</xsl:when>

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

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

  </xsl:when>

Mark

AnnaK
by
New Contributor II

Hi,

I have the same issues with formatting HTML popups. (I'm ArcGIS 10.2 working with shapefiles and HTML-popups for a Google Earth project).

Weird thing is that I used to work with the xsl scripts a lot last October to format HTML popups and I used to be able to see the changes in "..Properties/HTML Popup/Verify..". Now that I tried again it doesn't work anymore. My workaround is saving and closing the project and opening it again. But this is quite tedious.

For some reason copy and paste didn't work for me - and doesn't sound much more convenient.

So if anyone knows more about the core of the issue, getting rid of this issue, respectively, it 'd be very helpful!

Cheers,

Anna

0 Kudos
TijmLanjouw
New Contributor II

Hi Anna,

when using the workaround suggested by Mark (simply copy and paste the shapefile in table of contents) you at least don't have to close and open the entire project.

Tijm

0 Kudos
NicolasRoger
Occasional Contributor

Any real fix to this bug?

I have ArcGIS 10.5 and I got the same problem.

0 Kudos