Show Navigation | Hide Navigation
You are here:
Mapping and visualization > Navigating and interacting with maps > Interacting with maps

Adding hyperlinks to features

Release 9.3
Last modified April 24, 2009
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Interacting with maps"


Related Topics

About hyperlinks

Note: This topic was updated for 9.3.1.

You can access documents or Web pages related to features using the Hyperlink tool Hyperlink tool on the Tools toolbar. Hyperlinks let you provide additional information about the features to people who will be using your maps with ArcMap.

Hyperlinks have to be defined before you use the Hyperlink tool, and they can be one of three types:


You can define a hyperlink for the features in a layer either by defining a dynamic hyperlink or using field-based hyperlinks.


Dynamic hyperlinks

Dynamic hyperlinks are specified after you've used the Identify tool on a feature. With dynamic hyperlinks, you do not use an attribute field to supply the hyperlink targets. The names of targets you specify are stored in your map or in an .lyr file and are not tied to the underlying database.
The Add Hyperlink dialog box lets you specify either a file or a URL target since dynamic hyperlinks don't support macro values as targets. You can define any number of dynamic hyperlinks for a feature. If more than one hyperlink is defined for a feature, when the feature is clicked with the Hyperlink tool, a dialog box will appear from which the desired hyperlink can be chosen. You can use relative paths and Windows environment variables with dynamic hyperlinks, but you cannot use the Hyperlink Base setting.
Using a large amount of dynamic hyperlinks—for example, greater than 1,000—may result in slow performance in ArcMap when the Hyperlink tool is active. Because field-based hyperlinks are stored in the database, they perform much faster, even with a large number of hyperlinked features.


Field-based hyperlinks

With this type of hyperlink, the target document, URL, or macro value that will be launched is specified for each feature in a field in the layer's attribute table.

If you want to have your field-based hyperlinks use relative paths, there are two methods you can use. One way is to enter just the folder structure to traverse into the field, which allows more flexibility in organizing linked documents in different locations.

The other option is to specify a hyperlink base, which is the base path or URL used for field-based hyperlinks to documents or URLs. Paths or URLs for field-based hyperlinks accessed from that map will be preceded by the base. For example, if the hyperlink base is set to D:\Data, then the values in the field or fields used as hyperlinks to documents don't have to contain D:\Data. They can just contain the name of the file.

The Hyperlink Base property is specified on the File > Document Properties dialog box. If the location of the targets changes, you can simply edit this one setting instead of having to edit each value of the field providing the hyperlink targets. The Hyperlink Base setting has no effect on dynamic hyperlinks or field-based hyperlinks to macros. See Making hyperlinks with relative paths below for examples of how to specify the text for relative paths.

Field-based hyperlinks support system- and current user-level Windows environment variables. Environment variables must be set on the computer prior to utilizing them for hyperlinks.


Making hyperlinks with relative paths


Sometimes you may want to give a map that contains hyperlinks to someone who does not have access to your network resources. Just as you can save the map with relative paths to the data, you can also specify hyperlinks that refer to a location relative to the map.

To specify a path to a document in the same folder, type the document's name. For the example below, you would type directions.bmp.

Shows a document within the same folder as the Map document


To specify a path through a folder immediately below the map's location in the file system, start the path with the folder name. Do not use a \ or drive letter prefix. For the example below, you would type "Graphics\directions.bmp".

Shows a document within a folder immediately below the Map document's location


To specify a path to a document in a sibling folder, start the path with "..\" and the folder name—for example, "..\Graphics", where the file is in Graphics and the map is in Maps and both folders are in another folder. For the example below, you would type "..\Graphics\directions.bmp".

Shows a document within a sibling folder



Using parameters to control how a program opens a hyperlinked document

Hyperlinks to documents can contain parameters that define how the program opens the document. For example, parameters can tell Adobe Reader to open a .pdf to a specific page, allowing map features to hyperlink to different pages in the same document. Since each software package (such as Microsoft Word, Microsoft Excel, Adobe Reader, and so on) has unique commands, consult the documentation for the software package used to open the document for the parameters and syntax available to it.
Many times, these parameters will be provided for use in a command line. For example, to open a .pdf document to page 5, the command line might look like the following:



where


ArcGIS does not read these parameters like a command line. Instead, it uses a special delimiter, a ? (question mark), to separate the file path from the parameter. The hyperlink to the same document and page in ArcGIS would look like this:



The ? serves as the delimiter between the path and the parameter.

Field-based hyperlinks containing these parameters will not work in releases prior to ArcGIS 9.3. If you save an ArcGIS 9.3 map document to a previous release, parameters will automatically be removed from dynamic hyperlinks, but the links to the document will still work.


How to define and access hyperlinks

Accessing a feature's hyperlink

  1. Make sure the layer containing the feature for which you want to access a hyperlink is checked (visible) in the table of contents.
  2. Click the Hyperlink tool Hyperlink tool.
  3. Any visible features in the map that have hyperlinks defined are drawn in blue, the default color, or outlined in blue in the case of polygons. When you are over a feature for which a hyperlink exists, the mouse pointer turns into a pointing hand and you see a pop-up tip with the name of the target.
  4. Click the feature.
  5. A hyperlink is invoked. If more than one hyperlink has been defined for the feature you clicked, a dialog box will appear from which you can select the hyperlink you want to launch.

Tips

  • If you specify a Web address as a hyperlink, ArcMap starts your default Web browser and displays the Web page. If you specify a document as a hyperlink, ArcMap opens that document in its native program. If the linked document is on a server, the document is only available to those with access to that server.
  • The Hyperlink tool respects the selection tolerance, which is the search radius used by tools to select features. Only features falling within the search tolerance will be selected. You can set the selection tolerance on the Selection Options dialog box.
  • You can change the color used to indicate features with hyperlinks. See the task below for details.

Changing the color used to highlight hyperlinked features

  1. Click the Tools menu.
  2. Click Options.
  3. Click the General tab.
  4. Check the box to highlight hyperlinked features when the Hyperlink tool is active.
  5. Click the color box to specify a different color for the highlights. Blue is the default.
  6. Click OK.

Tip

  • Like all the settings on the General tab, this setting applies to all your ArcMap sessions and is not stored in your map document.


Defining dynamic hyperlinks

  1. Click the Identify tool Identify Features button on the Tools toolbar.
  2. Click the feature for which you want to define a hyperlink.
  3. Right-click the feature in the Identify window and click Add Hyperlink.
  4. Specify the desired hyperlink target.
  5. To link to a document, click Link to a Document and type a path to the document, or browse to it. If you want to use a relative path, type the folder structure by following the examples above (such as "file.txt", "folder\file.txt", or "..\folder\file.txt").

    To add a hyperlink to a Web page, click Link to a URL and type a URL (you can omit the http prefix of the URL).
  6. Click OK.

Tips

  • The Hyperlink Base setting (specified on the File > Document Properties dialog box) has no effect on dynamic hyperlinks.
  • Relative paths for dynamic hyperlinks are only supported for map layers and not .lyr files.
  • The path ..\folder\file.txt indicates that ArcMap should look up one level in the file system for a folder named folder and find the file named file.txt in this folder.
  • The path folder\file.txt indicates that ArcMap should look for a folder in the file system at the same level in which the map document is stored and look for the file file.txt in the folder.
  • After deleting features from a shapefile, you may find that dynamic hyperlinks are attached to different features. This occurs because ArcMap uses the feature ID (FID) field to associate dynamic hyperlinks with features, but the FIDs of shapefiles must be recalculated when features are deleted. To ensure hyperlinks are always associated with the proper features, only use dynamic hyperlinks with geodatabase features classes (geodatabase features always have unique ID values). Field-based hyperlinks can be used with shapefiles without this limitation.


Managing dynamic hyperlinks

  1. Click the Identify tool Identify Features button on the Tools toolbar.
  2. Click the feature that has the dynamic hyperlinks you want to manage.
  3. Right-click the feature in the Identify window and click Manage Hyperlinks.
  4. Click a hyperlink in the list and click Add New, Remove, Remove All, or Jump To.
  5. Click OK.

Tip

  • The Manage Dynamic Hyperlinks dialog box does not list field-based hyperlinks (hyperlinks that may have been specified for this feature on the Display tab of the Layer Properties dialog box). It only lists dynamic hyperlinks.


Defining field-based hyperlinks

  1. Create a text field in the attribute table containing the features to which you want to add hyperlinks. You will use this field to store the hyperlinked file names and paths.
  2. Start an edit session and add the hyperlinked file names to the table. Save your edits when you're done.
  3. If you want to use relative paths, type the folder structure by following the examples above (such as "file.txt", "folder\file.txt", or "..\folder\file.txt"). This method for entering relative paths allows more flexibility in organizing linked documents in different locations. Or if you are using a hyperlink base, enter the values that should be appended after the hyperlink base to complete the hyperlink path or URL.
  4. Right-click the layer in the table of contents and click Properties.
  5. Click the Display tab.
  6. Check Support Hyperlinks using field and click the drop-down arrow to choose the hyperlink field.

  7. Click the Document, URL, or Macro option to specify what type of hyperlink the selected field contains.
  8. If you choose the Macro option, specify the macro that the values in the field will be sent to when the hyperlinks are triggered.
  9. Click OK.
If you are using a hyperlink base, you also need to complete these steps:
  1. Click File on the main menu and click Document Properties.
  2. Click in the Hyperlink base text box and type the path to the hyperlinked documents such as C:\Data.
  3. Click OK.

Tips

  • The Hyperlink Base setting has no effect on dynamic hyperlinks or field-based hyperlinks to macros.
  • The path ..\folder\file.txt indicates that ArcMap should look up one level in the file system for a folder named folder and find the file named file.txt in this folder.
  • The path folder\file.txt indicates that ArcMap should look for a folder in the file system at the same level in which the map document is stored and look for the file file.txt in the folder.
  • By default, ArcGIS automatically adds a slash to the end of the hyperlink base: a forward slash / in the case of a hyperlink to a URL and a backward slash \ in the case of a hyperlink to a document. You can override this default by changing a setting in the ArcMap Advanced Settings Utility, which is located in your ArcGIS installation directory in the Utilities folder.
  • For example, if you want to use the hyperlink base setting with long URLs such as
    http://www.example.com/index.cfm?parameter=1234,
    you have to specify http://www.example.com as the base and store everything that comes after that (index.cfm?parameter=1234) in the hyperlink field. By overriding the default, you can specify most of the URL as the base:

    http://www.example.com/index.cfm?parameter=

    and just store the last part of the URL, 1234, in the hyperlink field.

    If you override the default, ArcMap will still retain the slash if the hyperlink base specified here ends in a slash character. So if you override the default, you can still add a slash manually to the hyperlink base.
    The setting to override the default only applies to your machine and is not stored as a property in the map document.

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.