Skip to main content
Drupal Documentation for SCLS

Main navigation

  • Home
  • How-To Info for Library Staff
  • Drupal 10
  • Help

Breadcrumb

  1. Home
  2. Drupal 10
  3. Content

Links to Webpages and Files

Note: If you are creating a link to a document/file, first add it to the Media Library using the steps to upload a file to Media or upload a file while you're editing content. Then use the steps below to make a link to it while editing a page/block.

To create a link:

  1. Type the text/insert the image for the link.
  2. Select the text/click on the image.
  3. Click the Link button. 
Image
Link balloon tooltip
Image
  1. The Edit Link tooltip will appear.
  2. Do one of the following:

Link to another site: 

  1. Type or paste the complete URL in the Link URL box.
  2. Click the green checkmark. The Link tooltip will close.

Link to a page on this site:

  1. Begin typing the page's title or a keyword from the title in the Link URL field. Autocomplete will suggest matching pages.
  2. Select the appropriate page from the list.
  3. Click the green checkmark. The Link tooltip will close.

Link to a document/file in the Media Library:

Image
Link autocomplete with a document
  1. If the file is already uploaded to the website, begin typing the Name/filename in the URL field. Autocomplete will suggest matching files.
    1. Select the appropriate file from the list.
    2. Click the green checkmark. The Link tooltip will close.
  2. If the document/file hasn't already been uploaded:
    1. If you've made edits that you want to keep, save the page where you are working. Use the steps for uploading files to Media, and then return to editing your page. Follow the previous steps to make a link to the file you uploaded.
      OR
    2. Use the steps for uploading a document while editing content. Then follow the previous steps to make a link to the file you uploaded. 

Link to a page generated by the "Views" module (such as the calendar):

  1. Enter a relative URL (the segment of the URL that follows the “.org”), including the slash.
  2. Example: for a link to http://www.example.org/calendar/month, enter only /calendar/month
  3. Click the green checkmark. The Link tooltip will close.

Tips & Reminders

  1. Make sure to click the green checkmark to complete the link. The link will not be inserted if this step is skipped.
  2. Save the page after making your link.
  3. Test the new link to confirm it goes to the expected location.

Advanced Options

Image
Advanced link options

Click "Advanced" in the Link tooltip to set the following options:

  • ARIA label (uncommon): Provide an alternative text value/label for assistive technologies. Example: When using link text such as "Read more," which may be repeated by other links on the page, ARIA label text can replace the link text with a more descriptive, accessible label (e.g. "Read more about XYZ specific topic"). The words 'Read more' are repeated in the aria-label (which replaces the original anchor text of "[Read more...]")
  • CSS classes: List of CSS classes to add to the link, separated by spaces.
  • ID: Allows linking to this content using a URL fragment. Must be unique.
  • Relation: It's recommended to add "noopener" when setting a link to open in a new tab/window to prevent a security vulnerability being exploited by the linked site.
  • Open in new window/tab (not recommended for most situations): "noopener" will also be added to the Relation field to prevent a security vulnerability being exploited by the linked site.

Bugs & Known Issues

Trying to make a link without clicking the green check mark

Bug: Making links

Putting a link to a document on an image (when both document and image are Media)

If you insert a Media image into a page, and then make a link to a Media document on the image, the link will fail. While editing, the link will point to "/media/NNN," but after saving it won't convert to the document's direct URL, and clicking on the link will result in a "Page not found" error. Workaround: Use the relative path to the document for links when you must link to a document on an image (e.g. /sites/www.example.org/files/samplefile.pdf). (Bug report.)

Book traversal links for Links to Webpages and Files

  • Formatting Content
  • Up
  • Making content sticky
  • Content
    • Removing Formatting from Copied & Pasted Content
    • Adding Content (Nodes)
    • CKEditor 5 Editing Toolbar Changes
    • Changing Authoring information - Drupal 9
    • Editing Existing Content (Nodes) on Your Website
    • Events: Repeating dates
    • Formatting Content
    • Links to Webpages and Files
    • Making content sticky
    • Using Editoria11y
  • Layout Builder
  • Managing Media & Files
  • Media Library
  • Revisions
  • Webforms
  • Webinars

Tags

accordion (1)
account (2)
anchors (1)
blocks (0)
cache (1)
carousel (2)
CKEditor (5)
configuration (1)
content types (1)
CSS (1)
disable rich-text (1)
Drupal 10 (15)
Drupal 9 (16)
email (2)
embed code (1)
Entity Registration (5)
events (6)
file browser (1)
files (4)
files media (1)
folders (1)
formatting (2)
front page (3)
Google Analytics (1)
headings (2)
HTML (1)
iframe (2)
images (4)
imce (1)
Layout Builder (3)
link a pdf (1)
links (5)
login (1)
media (2)
menus (3)
nodes (1)
openid (1)
paste as plain text (1)
paths (4)
performance (1)
photo albums (1)
photo galleries (1)
redirects (3)
registration (5)
remove format (1)
repeat dates (2)
reports (1)
revisions (1)
sidebars (0)
site name (1)
slogan (1)
source (1)
sticky (2)
text formats (1)
themes (1)
toolbar (2)
URL aliases (4)
Webform (2)
widget (1)