Conditionally display mediainfo photo in popuptemplate based on an attribute value

1335
10
Jump to solution
01-18-2022 11:30 AM
luckachi
Occasional Contributor III

I am trying to figure out if there is a way to conditionally hide the mediainfos section of a popuptemplate?

The photos are external (not attachments) and I have a column called PHOTOS that will say 0, 1 or 2. Ideally I would like the mediainfos section not show if 0 appears in the PHOTOS attribute but so far nothing I have tried is working. 

Does anyone have any insight into how this might be accomplished if it is even possible?

I'd like to avoid the broken image icon, like in the screenshot below so folks don't think that it's not working.

luckachi_0-1642534182978.png

 

0 Kudos
10 Replies
MatthewDriscoll
MVP Alum

I add this at the end of the function to replace the image with a note if no image found.

 

.fail(function() { console.log("nada"); let ele = document.getElementById("photoContainer"); ele.innerHTML += "NO IMAGES AVAILABLE ";})
0 Kudos