Skip to main content
SLAC National Accelerator Laboratory
SLAC Drupal User Guide
  • Get Started
    • 5 things to do to launch your site
    • Request a site
    • Log into site
    • Update site name
    • Managing access
    • Conference web support
  • Organize & Build
    • Introduction to SLAC Drupal Sites
    • Manage Site Content
    • Site Organization & Menus
      • Anchor links
      • Linking to interior pages
    • Building blocks
      • Content Types
      • Paragraph Types
    • Content Examples
      • Basic Page Example 1
      • Basic Page Example 2
      • Basic Page Example 3
    • Recommended Image Sizes
    • Protect webforms from spam
    • Securing webforms
    • Glossary
  • Events
  • Support
    • Training videos
    • FAQ
    • Release Notes
  • Policies & Guidelines

Breadcrumb

  1. Home
  2. Organize & Build
  3. Site Organization & Menus
  4. …
Facebook Share X Post LinkedIn Share Email Send
  • Introduction to SLAC Drupal Sites
  • Manage Site Content
  • Site Organization & Menus
    • Anchor links
    • Linking to interior pages
  • Building blocks
    • Content Types
    • Paragraph Types
  • Content Examples
    • Basic Page Example 1
    • Basic Page Example 2
    • Basic Page Example 3
  • Recommended Image Sizes
  • Protect webforms from spam
  • Securing webforms
  • Glossary

Anchor links

What is an anchor link?

An anchor link, also referred to as a page anchor or jump link, is a type of hyperlink employed within a webpage to guide users to specific sections on the same page. 

 

How do I add an anchor link to my page?

You can add anchors to WYSIWYGs and to Section Intros. Anchors must be accompanied by other content for them to work.

Steps

  1. Click the Source button on the WYSIWYG editor or section intro editor
  2. Add an HTML tag: <div id="anchor_name"> on the place you want to link to. 
  3. Use the anchor URL by combining the page URL + "#" + anchor_name

Example

  • Create an anchor name, for example: stage1 to append to the page URL
  • Your page URL: https://drupalguide.slac.stanford.edu/get-started/5-things-do-launch-your-site
  • The URL to new anchor: https://drupalguide.slac.stanford.edu/get-started/5-things-do-launch-your-site#stage1

     

screenshot of how an anchor link is set up

Anchor link.png

August 31, 2023
screenshot of how an anchor link is set up
Download
Number of Slides



I can’t get the anchor to link to the right spot. How can I get this to work?

Because of the sticky navigation, the anchor destination might change, so you’ll need some trial and error to identify the best position to add the <div id="anchor"/>.

Tip: It is best not to test the anchor links as an editor but rather as a visitor (i.e. from an Incognito window for public sites or masquerading as a test_view for internal sites) to get a truer sense of the destination. 

Note: Anchor links are not functional within the Accordion Paragraph Type (PT), meaning that clicking on a link leading to content within an Accordion is not supported. Nevertheless, you have the option to insert a link using the WYSIWYG editor within the Accordion PT to direct users to either internal or external web pages.
 

SLAC Drupal User Guide
2575 Sand Hill Road, Building 50
Menlo Park, CA 94025
  • Policies & Guidelines
    • Acceptable Use of IT Resources
    • SLAC Branding and Style Guide
  • SLAC IT
    • IT website
    • Get help
  • Facebook
  • Twitter
  • Instagram
  • Flickr
  • Youtube
  • LinkedIn
  • Staff portal
  • Privacy policy
  • Accessibility
  • Vulnerability disclosure
  • Website feedback
SLAC
  • SLAC home
  • Maps & directions
  • Emergency info
  • Careers

© 2025 SLAC National Accelerator Laboratory is operated by Stanford University for the U.S. Department of Energy Office of Science.

Stanford University U.S. Department of Energy
Top Top
Back to top Back to top