Select to view content in your preferred language

Hyperlinks in viewer?

4149
5
Jump to solution
05-03-2012 10:23 AM
KarenEllett
Occasional Contributor
I have a data layer that includes a field with a hyperlink for each feature.  When I pull that data into the silverlight viewer, is there anyway to preserve the hyperlink?  When it shows the popup it includes the path as text, but is there anyway to preserve it's function as a hyperlink, so that the user can click it and pull up the document?  I know that an attachment can be added if attachments are enabled, but there are thousands and thousands of features, so individually re-attaching these documents isn't really an option.

Thanks!
1 Solution

Accepted Solutions
KarenEllett
Occasional Contributor
If anyone else has this problem, I've been able to get it to work with a local file. 

Once you've created your application, open the Map.xml in Visual Studio.  (Located under inetpub/wwwroot/Apps/YourApplication/Config)
Do a search for the field you're trying to enable.  (If you have the same field name in multiple layers, make sure you're looking at the correct layer.)  It will look something like this:

<esriMapping:LayerInformation.Fields>
<esriMapping:FieldInfo Name="Field1" DisplayName="Field 1" FieldType="Integer" AliasOnServer="Field1" DomainSubtypeLookup="None" />
<esriMapping:FieldInfo Name="Field2" DisplayName="Field 2" FieldType="Integer" AliasOnServer="Field2" DomainSubtypeLookup="FieldDomain" />
<esriMapping:FieldInfo Name="Field3" DisplayName="Field 3" AliasOnServer="Field3" DomainSubtypeLookup="None" />
</esriMapping:LayerInformation.Fields>


Find the field you want to change; in this case, Field 3.  Add "FieldType="Hyperlink" and save the file.  It should now look like this:

<esriMapping:LayerInformation.Fields>
<esriMapping:FieldInfo Name="Field1" DisplayName="Field 1" FieldType="Integer" AliasOnServer="Field1" DomainSubtypeLookup="None" />
<esriMapping:FieldInfo Name="Field2" DisplayName="Field 2" FieldType="Integer" AliasOnServer="Field2" DomainSubtypeLookup="FieldDomain" />
<esriMapping:FieldInfo Name="Field3" DisplayName="Field 3" FieldType="Hyperlink" AliasOnServer="Field3" DomainSubtypeLookup="None" />
</esriMapping:LayerInformation.Fields>

This should now show up as a clickable link in the popup, and will allow you access your local file.  Or at least, it works for me.

View solution in original post

0 Kudos
5 Replies
MarkBryant
New Contributor III
Hyperlinks in a pop-up work for me, but only if the text string starts with "http://".

A link just starting www.someaddress.org doesn't work. Neither have I managed to successfully hyperlink to local files with "\\UNC\folder\file.ext"
Don't forget that if you open the attribute table, you will only see the link as a plain text.
Mark.
0 Kudos
KarenEllett
Occasional Contributor
If anyone else has this problem, I've been able to get it to work with a local file. 

Once you've created your application, open the Map.xml in Visual Studio.  (Located under inetpub/wwwroot/Apps/YourApplication/Config)
Do a search for the field you're trying to enable.  (If you have the same field name in multiple layers, make sure you're looking at the correct layer.)  It will look something like this:

<esriMapping:LayerInformation.Fields>
<esriMapping:FieldInfo Name="Field1" DisplayName="Field 1" FieldType="Integer" AliasOnServer="Field1" DomainSubtypeLookup="None" />
<esriMapping:FieldInfo Name="Field2" DisplayName="Field 2" FieldType="Integer" AliasOnServer="Field2" DomainSubtypeLookup="FieldDomain" />
<esriMapping:FieldInfo Name="Field3" DisplayName="Field 3" AliasOnServer="Field3" DomainSubtypeLookup="None" />
</esriMapping:LayerInformation.Fields>


Find the field you want to change; in this case, Field 3.  Add "FieldType="Hyperlink" and save the file.  It should now look like this:

<esriMapping:LayerInformation.Fields>
<esriMapping:FieldInfo Name="Field1" DisplayName="Field 1" FieldType="Integer" AliasOnServer="Field1" DomainSubtypeLookup="None" />
<esriMapping:FieldInfo Name="Field2" DisplayName="Field 2" FieldType="Integer" AliasOnServer="Field2" DomainSubtypeLookup="FieldDomain" />
<esriMapping:FieldInfo Name="Field3" DisplayName="Field 3" FieldType="Hyperlink" AliasOnServer="Field3" DomainSubtypeLookup="None" />
</esriMapping:LayerInformation.Fields>

This should now show up as a clickable link in the popup, and will allow you access your local file.  Or at least, it works for me.
0 Kudos
DerekGliddon
Occasional Contributor
Great! Works for me.  I have thousands of geo-tagged photos and this now lets me publish them.
0 Kudos
TomMagdaleno
Regular Contributor
Thank you Karen!  One FYI for anyone else doing this, you have to use UNC paths for your hyperlink.
0 Kudos
HenryKovacs
New Contributor II
How can i replace my UNC path with the words "Click Here To View Image"?  The UNC path is quite long and users don't need to see it.  Basically I want to hide the path to simplify the contents of the field. 

Thanks in advance!
0 Kudos