Anchor Navigation
The Anchor Navigation component displays a list of anchors on a page. This shows your visitors the page structure and allows them to navigate to a section with just one click.
The menu below – with links to Uses, Best practices, Accessibility and Design options – is an example of anchor navigation.
Set up the Anchor Link components
- Add an Anchor Link component just above each section the anchor navigation will link to.
- Open the component for editing.
- Fill in the Anchor link field with a short, lowercase word without any spaces. For example:
- uses
- bestpractices
- Click OK.
- Repeat as needed.
Set up the Anchor Navigation component
- In the AEM Sidekick, expand the Concordia section.
- Drag the Anchor Navigation component and place it just above the first content section on the page.
- Open the component for editing.
- Click Add item to add an item to the anchor navigation menu. Repeat as necessary.
- For each navigation link, add a clear, descriptive Title that matches the heading of the corresponding page section. For example:
- Uses
- Best practices
- Fill in the Anchor link field with the same word you used in the Anchor Link component. For example:
- uses
- bestpractices
- best-practices
- If needed, use the green arrows to arrange the navigation items so they match the order of page sections.
- Click OK.
- Test each link in the anchor navigation. If a link doesn't work, it's because the anchor links in the Anchor Navigation component and the Anchor Link component aren't exactly the same. Resolve the difference, then test again.
- Once all links are working, activate the page.
If the Horizontal anchor navigation spans more than one line, change it to Vertical. Here's how:
- Open the Anchor Navigation component for editing
- Go to the Settings tab
- Click the checkbox beside Vertical
- In the Navigation title field, add the words On this page:
Because the vertical navigation is long, this title helps orient your visitors.
- Click OK
- Sometimes when you preview and refresh the page, it may look like there's too much padding above the Anchor Navigation. If so, open the component for editing, click the Settings tab and check the No top padding box.