externalLink

This is used to insert a link to an external URL of some sort such as a website.

Usage

An external link consists of the following nested elements.

Name

Description

linkText

This is a required element and is used to specify the text to use for the inner text of the link.

linkAlternateText

This is an optional element. It is used to specify alternate text for the link that will be displayed when the mouse hovers over it.

linkUri

This is a required element and is used to specify the URL to which the link refers. This can be any sort of link (HTTP, FTP, mail, etc).

linkTarget

This is an optional element. It is used to specify the target window to use when the link is clicked. If omitted _blank is used to open the external link in a new window. The value _self can be used to open the link in the same window as the topic thus replacing it.

  Note

If the URL in the linkUri element contains XML entities such as the ampersand (&), you must encode them or a build error will occur. See the example below.

Example

 
Only link text and URI: <externalLink>
    <linkText>Sandcastle Help File Builder</linkText>
    <linkUri>https://GitHub.com/EWSoftware/SHFB</linkUri>
</externalLink>

Added alternate text: <externalLink>
    <linkText>Sandcastle Help File Builder</linkText>
    <linkAlternateText>Visit SHFB on GitHub</linkAlternateText>
    <linkUri>https://GitHub.com/EWSoftware/SHFB</linkUri>
</externalLink>

Added link target: <externalLink>
    <linkText>Sandcastle Help File Builder</linkText>
    <linkAlternateText>Visit SHFB on GitHub</linkAlternateText>
    <linkUri>https://GitHub.com/EWSoftware/SHFB</linkUri>
    <linkTarget>_self</linkTarget>
</externalLink>

If the link contains XML entities, they must be encoded (i.e. the ampersand):
<externalLink>
    <linkText>MSDN Documentation Forum</linkText>
    <linkUri>https://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=66&amp;SiteID=1</linkUri>
</externalLink>

Example Output

Only link text and URI: Sandcastle Help File Builder

Added alternate text: Sandcastle Help File Builder

Added link target: Sandcastle Help File Builder

If the link contains XML entities, they must be encoded (i.e. the ampersand): MSDN Documentation Forum

See Also

Other Resources