Select to view content in your preferred language

Conditional display of expressions not working for popups in the new map viewer

875
6
08-17-2022 08:44 AM
TimConfare2
Regular Contributor

I'm creating a popup with four possible links depending on results of an expression (using Text content).  If expression19 doesn't meet the criteria then it returns "none" and then the link does not display.  If it does meet it then it returns "inline" and shows the link.  Here is the code that worked great in the classic Map Viewer:

-------- 

<span style="display:{expression/expr19}">

<br /><a href="{expression/expr17}" rel="nofollow ugc" target="_blank">{expression/expr20}</a>

<br /></span>

----------

In the new map viewer <span> does not work (If you add <span> then click out of the html source and back in, it is erased).  I was able to get <div> to work but it puts it all on the same line.  If I add </ br> after the <div> the editor automatically deletes it.  I'm not able to get a newline to work after the <div>.

It appears like adding html to popups have taken a step backwards in this new map viewer.  Very frustrating.  Any ideas on how to make a conditional line?

Thanks in advance.

6 Replies
RyanKelley_NA
Regular Contributor

Did you ever figure this out?  I am having the same problem.

0 Kudos
RyanKelley_NA
Regular Contributor

I should also add that <span> seems to work for things like color and font size but as soon as you add any type of display item (like display:inline or display:block) that section gets deleted.

0 Kudos
TimConfare2
Regular Contributor

I never did get this working right.  I just have extra blank lines if the expression is false.  Doesn't look good but it works.

0 Kudos
RyanKelley_NA
Regular Contributor

There currently is an open bug/enhancment request for this: ENH-000160093

0 Kudos
RyanKelley_NA
Regular Contributor
0 Kudos
AdamBargar_PUCO
Emerging Contributor

I have been battling this same issue for a while now. I just cannot get the new map viewer to work with <span> html to keep things inline. I use it to filter out blank space from a popup if no data is found within a certain field. Currently, if I need to edit the popup at all, I have to do it in map viewer classic. This however messes up my symbology, so I have to save the popups in map viewer classic, and re-edit the symbology in the new map viewer. This is quite concerning as map viewer classic is supposed to be retired this year.

0 Kudos