Infrastructure Map Server General

Reply
New Member
Posts: 1
Registered: ‎06-25-2012
Message 1 of 2 (605 Views)

Tooltip hyperlink display code

605 Views, 1 Replies
06-25-2012 06:18 AM

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 =)

Valued Mentor
Posts: 269
Registered: ‎10-06-2008
Message 2 of 2 (599 Views)

Re: Tooltip hyperlink display code

06-25-2012 08:24 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community