Links can be added in the WYSIWYG editor and in specific content blocks containing link fields.

Create Accessible Links

Avoid links that say, "Read more", "See all", and "Click here" since this provides no context for where the link is taking a user. Instead, use more descriptive link text, such as "Register for TechExpo" or "View all Events".

Add Links via WYSIWYG Editor

1. In the WYSIWYG editor, click the Link icon.

  • You can also highlight the desired text or image to be linked, and then click the Link icon.
Image
Screenshot of WYSIWYG Editor showing options available, with Link icon selected

2. To link to pages within your site (internal link), start typing the name of a page you want to link to and select it from the auto-suggest dropdown.

  • For links to list pages, simply enter the appropriate URL (e.g., /news) from the List Page URLs quick guide.
  • Using the above methods of linking to internal content ensures you are using the relative URL (e.g., "/news"), and not the absolute URL (e.g., "https://yoursite.cloud.duke.edu/news") – so your links will not break when your site launches at your production URL.
Image
Screenshot of link field in WYSIWYG editor
Image
Screenshot of link field in WYSIWYG editor showing how auto-suggest works for internal links

 

3. To link to pages outside of your site (external link), simply copy/paste the link into the Add Link field.

Image
Screenshot of link field in WYSIWYG editor showing external link URL

Links opening in new tabs

Sites@Duke Pro does not allow links to open in a new tab or window, following web accessibility best practices.

Anchor Link

1. In the WYSIWYG editor, click the Anchor icon.

Image
Screenshot of WYSIWYG Editor showing options available, with Anchor link selected

2. In the Anchor Name field, add a short title for your anchor.

  • Example: mediabutton
Image
Screenshot of Anchor Link field

3. Highlight the text you want to link to your anchor. Select the Link icon (see previous steps above) and enter all the characters of your internal link after your main URL followed by the "#" character and the Anchor Name you created in step 2.

  • Example: If the URL you want to link to is https://sitespro-userguide.duke.edu/manage-media/upload-media, then use the following to link to your anchor: /manage-media/upload-media#mediabutton
Image
Screenshot of Edit Link field showing an anchor link

Linking Directly to Image Files

1. In the Media Library, find the Image you want to link to, and click Edit.

2. Click on the Preview link beneath the Image.

3. Right click on the Original Image to open it in a new tab (this action may vary across browsers).

4. In the new tab, copy the URL of the original image. Note that this URL belongs to your content site, so it is only accessible on the Duke network or VPN.

5. In that URL, replace the word "content" with "files" (e.g., change "yoursite-content" to "yoursite-files"). This is now the publicly accessible URL of the original image.

6. Enter this publicly accessible URL in any link field to link directly to the image file.

Linking Directly to Files (e.g., PDF files)

1. In the Media Library, find the File you want to link to, and click Edit.

2. Under the Document heading, click the filename link (e.g., filename.pdf). A preview of the file will open in a new window (this action may vary across browsers).

3. In the new tab, copy everything after the ".edu" in the URL – for example: /sites/default/files/filename.pdf.

4. Enter this value into any link field to link directly to the file. Note: At this time, files/PDFs do not appear as dropdown options in any type ahead fields, though this is on our Roadmap.

Add Links via Specific Content Blocks

1. For content blocks that have link fields, you will need to add the Link URL. The link can be to another piece of content on your site (internal link) or to a page on another site (external link). 

  • Note: For links to list pages, simply enter the appropriate URL (e.g., /news) from the List Page URLs quick guide.

2. Add Link text which is what the link will say on your site. Be sure to make your link text accessible so that it is clear what you are linking to.

Image
Screenshot of Link field available on some content blocks