Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tooltip hyperlink display code

1 REPLY 1
Reply
Message 1 of 2
garrettswift
919 Views, 1 Reply

Tooltip hyperlink display code

Hello guys, I am hoping someone can help me un-rig this code.

 

Basically I am working to add a hyperlink to my tooltips, no problem I was easily able to add it.

 

The probelm:

The hyperlink I am using is from a vendor and some of my items in the layer do not have a hyperlink. So it is displayed on every one of my items whether there is data for a link or not. This wouldnt be a big deal except for when there is not data for a link it blows up the webpage and the user loses their map view settings they where currently at.

 

I am wondering if there is a way to code it as an if there is data for a link then display hyperlink; if not then dont display hyperlink.

 

Here is what I have rigged up (very ugly and I dont like it):

 

'\n', '<a href=' ,  diLink , '  target="_blank">DI LINK</a>',  ' ....do not click unless ( ', Length (diLink), ' ) > 0')

 

bsically I have it count the characters and spit out the # and tell them that 0 means there is not data.... This is ugly and really just not very professional.

 

Any ideas? I want to clean this up 😃

1 REPLY 1
Message 2 of 2
jackie.ng
in reply to: garrettswift

If the function is available in the expression editor, use the If() function

 

If ( [condition], [value-if-true], [value-if-false] )

 

So something like this:

 

If ( Length(diLink) > 0, Concat('<a href="',  diLink , '" target="_blank">DI LINK</a>'), '')

 

Will give you the hyperlink HTML if diLink isn't empty and an empty string if it is

 

- Jackie

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report