Using Arcade or HTML to hide/display hyperlink in popup

433
2
Jump to solution
03-25-2021 06:41 AM
Labels (1)
JoshuaBillings
New Contributor III

Hey all,

I am trying to get a hyperlink to show only if the feature is "Reservable." (This layer deals with Picnic Shelters and Playgrounds).

I've created an expression that creates a hyperlink if it is reservable, but I don't want the hyperlink text to show up at all if it is not able to be reserved. See pictures for a little bit more context.

Is this possible?

Thanks!

JoshuaBillings_0-1616679143833.png 

JoshuaBillings_1-1616679169057.png

 

 

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
Regular Contributor

Create another expression:

// expression/display_reservation_link
// returns 'none' if the feature is not reservable, else returns 'block'

var reservable = $feature.Reservable  // or however you determine if the feature is reservable
return IIF(reservable, 'block', 'none')

 

Go into your popup, switch to HTML source. Find your link and put it into a div:

<div style="display:{expression/display_reservation_link};">
<a href="{expression/reservation_link}">Click here to Learn How to Reserve!</a>
</div>

Have a great day!
Johannes

View solution in original post

2 Replies
JohannesLindner
Regular Contributor

Create another expression:

// expression/display_reservation_link
// returns 'none' if the feature is not reservable, else returns 'block'

var reservable = $feature.Reservable  // or however you determine if the feature is reservable
return IIF(reservable, 'block', 'none')

 

Go into your popup, switch to HTML source. Find your link and put it into a div:

<div style="display:{expression/display_reservation_link};">
<a href="{expression/reservation_link}">Click here to Learn How to Reserve!</a>
</div>

Have a great day!
Johannes
JoshuaBillings
New Contributor III

Perfect! Thank you @JohannesLindner !

0 Kudos