Information Resources & Technology (IRT)

Add Body Links

Users cannot browse to your page, and search engines cannot index it, until there is a link to the page somewhere. Links in the Breadcrumbs and LeftColumn navigation areas are covered in later tutorials. In this tutorial, we place links into the text body of a page.

Watch Demo

Step 1: Add a link to your new page body

  1. Find a page in your browser to add the link to; your home page (index.html), for example
  2. Add an "absolute URL" link to an external site
    • An absolute URL is the full URL, including http:// or https://; the browser can always find this item using the absolute URL, regardless of context
    • Select a short range of text to link from
    • Find the Link field in the properties inspector
    • Type or paste in the full URL (beginning ) of any external site, such as http://www.stanford.edu/
    • Press Enter or exit the Properties Inspector to set the link
  3. Add a "document-relative" link to an internal page using the Browse function
    • Document-relative URLs begin without http:// or an initial "/"
      • "my_page.html" tells the browser to look in the same directory as the linking page
      • "education/my_page.html" tells the browser to look in the same folder as the linking page for a folder called education and the nested my_page.html
      • "../my_page.html" tells the browser to back out of the linking page's folder and then look for my_page.html
    • Select a short range of text to link from
    • Find the Link field in the properties inspector
    • Click the Browse icon (looks like a folder) next to the Link field; browse to a page file, such as "my_page.html" and select it
    • Press Enter or exit the Properties Inspector to set the link
  4. Add a "document-relative" link to an internal page using the Point to File function
    • You must be sure the Local Files list is showing on your screen
    • Select a short range of text to link from
    • Find the Link field in the properties inspector
    • Click and hold on the Point to File icon (looks like cross hairs) next to the Link field, and drag it over to the list of Local files
      • Hover over a folder, such as Education; point at the index.html file inside and release to select it
      • You can also point at any active document window to link to it, or to any anchor link within an on-screen page to link to the anchor
      • Point to File is especially handy for creating "jumper" links to anchors on the same page

Step 2: Edit an existing link

Occasionally you will need to revise a link. You can edit the link text by selecting it or placing your cursor within the linked area and typing. To change the link URL:

  1. Place your cursor anywhere within the linked text

  2. Find the Link field in the Properties Inspector
  3. Replace the link, using any of the techniques detailed above.

Links to avoid

  1. Unencrypted, or "naked" MailTo links are an open invitation to spam and so are not recommended; MailTos take the form (in code) <a href="mailto:somebody@someplace.edu"> See Step 3 for an alternative.
  2. Root-relative URLs
    • URLs that begin with a slash, e.g. "/education/index.html" tell the browser to find the root of the domain and look for the indicated resource
    • This type of URL is used extensively in the locked parts of the format, but is not recommended for use within your pages

Step 3: Add Spam-proof Email Links

Through a combination of text, link and CSS style, you can provide functional mailto links without risking spam.

To create a spam-proof email link to “youralias@stanford.edu”:

When published, the browser will rebuild the link so that “Center Info” links to “mailto:youralias@stanford.edu" without exposing the address to Spam.

Variations

Optional: Link to a Downloadable File

If desired, you can jump ahead to the exercise to Add Downloadable Documents, including a body link to the downloadable file.

 

« Previous | Home | Next »

Stanford Medicine Resources:

Footer Links: