Infrastructure Map Server General

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

Tooltip hyperlink display code

626 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>',  ' 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: 273
Registered: ‎10-06-2008
Message 2 of 2 (620 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

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

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

Ask the Community