I want my pop-up to show a photo (from a website) with a link to the site. But it should only show the photo if the Attachment_URL field is not empty. The specific HTML tag that should be returned is
<a href="{Attachment_URL}?size=full"><img class="image_resized" style="width:100%;" src="{Attachment_URL}?size=lg" alt="Photo of a tree"></a>
Here's the expression I've tried, but it returns nothing on my pop-up.
var photoURL = `<a href="{Attachment_URL}?size=full"><img class="image_resized" style="width:100%;" src="{Attachment_URL}?size=lg" alt="Photo of a tree"></a>`
IIf (isEmpty($feature.Attachment_URL), '', photoURL)
What am I doing wrong?
Where are you assigning the Attachment_URL? Try this instead
var photoURL = `<a href="{$feature.Attachment_URL}?size=full"><img class="image_resized" style="width:100%;" src="{$feature.Attachment_URL}?size=lg" alt="Photo of a tree"></a>`
IIf (isEmpty($feature.Attachment_URL), '', photoURL)
That still doesn't work. I just get blank line even if there is a photo present.