How to use HTML in an attribute field

941
5
Jump to solution
05-12-2022 05:36 AM
JasonBennett
New Contributor II

I have a KML that has points. These points have a popup that use HTML to display tables and images. When I convert the KML to a layer in ArcGIS Pro, the popup parses the HTML and CSS and displays as expected.

JasonBennett_1-1652358736378.png

 

I've uploaded this layer to AGOL, and attempted to set the popup display to 'A custom attribute display' and simply put in the attribute tag.

JasonBennett_0-1652358647403.png

However, it displays the HTML as text in the popup.

JasonBennett_2-1652358864924.png

How can I get AGOL to display the HTML properly?

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JasonBennett
New Contributor II

As it turns out, Arc is trying to display the HTML. However, it doesn't like the stuff in the <head> such as styles and scripts. If I remove the beginning of the HTML, everything is displayed, but some formatting is lost due to removing the styles (and the scripts were unnecessary in this context anyway).

Right now it is working well enough and the popup is set as a list of field attributes...

JasonBennett_0-1652715502699.png

 

View solution in original post

5 Replies
by Anonymous User
Not applicable

Are you putting the html in the right window? Have you clicked the button in the top right with the arrows on to get to the html window?

JasonBennett
New Contributor II

Thanks for the reply!

Yes. I've done it both ways. However, I'm not actually putting any HTML in myself. This HTML exists in the 'PopupInfo' attribute field.

0 Kudos
by Anonymous User
Not applicable

It'll be interesting to know the solution. I've used custom attribute expressions in the pop-up which have worked well - but I don't know the answer to your problem.

Thanks for my first kudos - even though I didn't give you the right solution!

0 Kudos
JasonBennett
New Contributor II

As it turns out, Arc is trying to display the HTML. However, it doesn't like the stuff in the <head> such as styles and scripts. If I remove the beginning of the HTML, everything is displayed, but some formatting is lost due to removing the styles (and the scripts were unnecessary in this context anyway).

Right now it is working well enough and the popup is set as a list of field attributes...

JasonBennett_0-1652715502699.png

 

LayerItOn
New Contributor III

Hello, 

Would you be able to share your code that made the iframe work? 

Thank you!

0 Kudos