Insert a link in a text field

Last updated Monday, July 9, 2018 in Sitecore Experience Platform for Content Author
Keywords: Text fields

In Rich Text fields or Word fields, you can use the Insert Sitecore Link functionality or the Hyperlink Manager to create a link on either an image or a text string.

Note

To make sure that links do not break when items are, for example, renamed, deleted, or moved, all the links to Sitecore items or media items should have the format:

<img ... src="-/media/{ITEM_ID}.ashx" />

or

<a href="~/link.aspx?_id={ITEM_ID}&amp;_z=z">

For example, <img alt="logo" height="51" width="204" src="-/media/094AED0302E7486880CB19926661FB77.ashx" />

This topic outlines how to insert a link with:

You can insert a link in both Rich Text fields and Word fields to:

  • An item on your website – for example, to a different page on your website.
  • A digital asset – for example, a video or a PDF file in your Media Library.

To insert a link:

  1. In the Content Editor or the Experience Editor, navigate to the text field where you want to insert a link.
  2. In the text editor, select the text or image that you want to be a link and click either Insert Sitecore Link icon_RTE_InsertSitecoreLink' (in the Rich Text field) or Insert a Link (in the Word field).

    Note

    In the Experience Editor, you can insert an internal link directly on the page from the floating toolbar.

  3. In the Insert Link dialog, select the item that you want to link to and click Link. To locate the item, on the Internal Link tab or the Media items tab, you can browse to the item in a tree structure, or on the Search tab, you can search for the item.

    Note

    If you want to insert a link to an item that is hidden, for example, to an item bucket, you must use the search functionality to find the item.

    cms_ce_InsertlinkDialog

To remove the link, select the link in the text editor and click Remove Link icon_RichTextEditor_RemoveLink. The link is removed and the text becomes normal text.

If you want to change an existing link entirely, you simply create the new link on top of the old one.

If you want to insert a link to external websites, an email link, or create anchors on a page, you must use the Hyperlink Manager.

With the Hyperlink Manager, you can insert a link to:

  • An external website.
  • A media item – for example, a video or a PDF file from your Media Library.
  • An anchor in the same text field – a bookmark that links to a particular section within a page.
  • An email address – a link that opens and creates a new email in the visitor’s default email program.

Note

The Hyper Link Manager is only available in Rich Text fields, if you want to insert links in a Word field, you must use the Hyperlink functionality from within Microsoft Word or the Insert Sitecore Link functionality.

To insert a link with the Hyperlink Manager:

  1. In the Content Editor or the Experience Editor, navigate to the item or page where you want to insert a link and open the text editor.
  2. In the text editor, select the text or image that you want to be a link and click Hyperlink Manager icon_RTE_HyperlinkManager.

    Note

    In the Experience Editor, you can insert an external link directly on the page from the floating toolbar.

  3. In the Hyperlink Manager, to insert a link to:
    • An external website, on the Hyperlink tab, in the URL field, enter the URL of the website that you want to link to.
    • A media item, on the Hyperlink tab, click Document Manager icon_HyperlinkManager_DocumentManager and select the media item that you want to link to. From the Document Manager, you can also upload a new media file to the Media Library.
    • An existing anchor, on the Hyperlink tab, in the Existing Anchor field, select the anchor that you want to link to. If the appropriate anchor is not available, you must create the new anchor first.
    • An email address, on the E-mail tab, enter the email address that you want the email sent to and enter a description in the email subject line.

    cms_HyperLinkManager_HyperlinkTab

    cms_HyperLinkManager_EmailTab

  4. If you want a hyperlink to have a tooltip that appears when the user moves their cursor over the link, enter this text in the Tooltip field.
  5. For hyperlinks, in the Target field, specify how you want the link to open in a browser. For example, specify that you want the link to open in the same window or a new window.
  6. Specify the style sheet in the CSS Class field.
  7. Click OK.
  8. To remove the link, select the link in the text editor and click Remove Link icon_RichTextEditor_RemoveLink. Then, the link is removed and the text turns into normal text.

If you want to edit a link, you select the link in the text field and in the Hyperlink Manager dialog box, you make the necessary changes to the link and then click OK.

To change the existing link entirely, you simply create the new link on top of the old one.

Send feedback about the documentation to docsite@sitecore.net.