Anchor navigation

Use anchor navigation when you need an in-page table of contents with jump links to sections.

Live demo

Anchor navigation gives people a short list of jump links to sections on the same page. It works well on long pages where readers may only need one section (for example overview, fees, contacts, or deadlines). You choose horizontal placement (often a slim bar) or vertical placement (often a sidebar), plus an optional title and visual treatment so the block fits the page.

Authors name each link and point it at the correct in-page target. Those targets must exist in the content (for example headings or landmarks with matching ids). If no links are configured, the block does not appear for visitors; authors still see a placeholder in edit mode.

Behaviour

Selecting a link scrolls the page to the matching section. The pattern is for in-page movement only, not for opening other sites or full new pages.

Horizontal layouts suit space under a hero or above the main column. Vertical layouts suit a sidebar next to long reading content. Match density and contrast to the background so links stay easy to see and tap.

Anatomy

  1. Navigation region wrapping the whole component.
  2. Optional title (for example “On this page”) when vertical layout and title are used.
  3. List of links, each pointing to a fragment on the page.

Content guidelines

  • Write short, specific link labels that match the section headings they jump to.
  • Keep the number of links modest so the list scans quickly; very long pages may need fewer, higher-level anchors rather than every subsection.
  • Add a clear accessible name when link text alone could be vague (for example several links that all say “Read more”). Coordinate with content so ids and labels stay in sync when sections move or rename.
  • Use fragment targets only. This component is not for external URLs or full page paths.

When to use

  • Long pages with clear sections and stable in-page targets.
  • A sidebar “table of contents” or a horizontal strip of jumps under the hero or intro.

When not to use

  • Multi-step or multi-page journeys; use step or task navigation suited to flows across pages.
  • Site or section navigation; use primary, secondary, or other nav patterns meant for moving between pages.
  • When everything fits above the fold with no real need to jump.

Best practices

Do

  • Confirm each jump target exists on the page before publish.
  • Order links in a logical reading order (often top-to-bottom on the page).
  • Test on mobile so the anchor strip or sidebar does not crowd the main content.

Don't

  • Point links at missing ids or sections that were removed.
  • Use anchor navigation as a substitute for primary page navigation or breadcrumbs.

Related

Resource
Step navigationMulti-step flows across pages.
Secondary navigationIn-section navigation between pages.
BreadcrumbHierarchy trail, not in-page jumps.
  • aria-label="Local navigation" on the nav.
  • Links use aria-label from authoring when provided (link.ariaLabel in HTL).
  • Icons use role="presentation" / aria-hidden="true" where appropriate so they do not duplicate the link name.

CRXDE Lite query

Use this query in CRXDE Lite to find instances of this component.

/jcr:root/content//*[@sling:resourceType = 'concordia/components/anchor-navigation/anchor-navigation.html']
ItemLocation
HTLapps/concordia/components/anchor-navigation/anchor-navigation.html
Sling Modelorg/concordia/wcms/core/models/AnchorNavigationModel.java
Dialogapps/concordia/components/anchor-navigation/dialog.xml
Clientlibetc/designs/concordia/clientlibs/anchor-navigation/

Note: There is no anchor-navigation.jsp; the resource renders through HTL and the model.

Authoring fields

FieldPurpose
LinksMultifield (anchornavigationitem): link text, path (fragment id), optional aria label.
Link colourdefault, black, or white (dialog notes blue/black/white usage on backgrounds).
HorizontalNo background, with border, centre align, left padding (horizontal layout only).
VerticalCheckbox; navigation title, title colour (burgundy, black, white), no top padding.
CSS classOptional additionalClass appended to the container classes.

Anatomy (markup)

  1. Root: nav with class from model.containerClasses, aria-label="Local navigation".
  2. Optional title: p.c-anchor-navigation__title with colour modifier (vertical + non-empty titleNav).
  3. List: ul.c-anchor-navigation__list with li.c-anchor-navigation__list-item and a pointing to #linkPath.

Instances in the codebase

Location Notes
apps/concordia/components/anchor-navigation/anchor-navigation.html HTL view; uses AnchorNavigationModel.
org.concordia.wcms.core.models.AnchorNavigationModel Parses links, builds container classes, exposes showTitle when vertical and title set.
Page templates Included as concordia/components/anchor-navigation on some academic templates (for example degree program, CCE program/course).
faculty-profile-default.jsp Hard-coded “On this page” markup for profile anchors (same BEM family, not the component).