Map Tip Hyperlinks
I have features that I want to include links for the websites in the map tips. There are different websites for different features, and not each feature has a website. I added the following code to the map tips:
<a href="{FacilityWebsite}" target="_blank">Visit Website</a>
It works great for the features that do have web sites, but the ones that don't have web sites still show a link (which obviously does nothing as "FacilityWebsite" is null). Is there a way for no link to show in map tips for features with no website? Or is there a way to show feature hyperlinks (made in the "Feature Hyperlinks" tab in the layer) in the map tips, since I can tell that to hide invalid links?
0
-
UPDATE
I changed it to display the URL for the hyperlink instead of "Visit Website". Now it doesn't show a hyperlink for the features with no accompanying website. This works for this layer, as none of the URL's are very long. However, I am still interested in another solution in case I need to do something similar for features with longer URL's.<a href="{FacilityWebsite}" target="_blank">{FacilityWebsite}</a>0 -
I've used one to one data links to generate hyperlink text for URLs only when they exist. Something along the lines of:
SELECT 'Visit website' AS Link
FROM MyTable
WHERE MyTable.URLField IS NOT NULL
AND MyTable.IDField = @ID
I also use a similar method for determining whether or not to show links to run workflows or to show photo attachments.
The downside is that it adds the field to your feature details as well, but in most places that I use it I've either turned the feature details off or have accepted it because it's more important to have a clean link.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare