Anchor component
Inserts a tiny piece of code that allows you to link to a specific location within a web page.
Component(s) you might want to use with this one:
- Anchor navigation
- WYSIWYG
- Any component that sets a hyperlink or call to action (Button, Card, Hero)
Guidelines
An anchor is a tiny piece of code that is appended to a hyperlink. The anchor allows you to link to a specific location on the page instead of the top. If a web page URL is like an apartment building address, then the anchor is like your apartment number – a specific location within that address.
Anchor links have 2 parts:
- the anchor id
- the link that points to the anchor
Part I – add the anchor
- Drag the anchor component to the spot on your page.
- Give it a simple url-friendly name (lower-case, no spaces). This is the anchor id.
![Anchor link Anchor link component showing icon and text field to input url-safe name](/content/concordia/en/web/design/components/anchor/_jcr_content/content-main/grid_container_783254608/grid-container-parsys/image.img.png/1619013605439.png)
Part II – add the hyperlink
To link to an anchor on the same page:
- Enter # followed by the anchor id in any hyperlink field, e.g.: #support
![Linking to an Anchor from the WYSIWYG component Anchor id is entered in the Link field, e.g. #support](/content/concordia/en/web/design/components/anchor/_jcr_content/content-main/grid_container_783254608/grid-container-parsys/image_751241394.img.png/1622041385747.png)
![Linking to an Anchor from the Button component Anchor id is entered in the Link field, e.g. #support](/content/concordia/en/web/design/components/anchor/_jcr_content/content-main/grid_container_783254608/grid-container-parsys/image_1301417912.img.png/1622041370624.png)
To link to an anchor from a different page
- In any hyperlink field, use the relative path of the destination page followed by .html#[anchor id]
![Linking to an anchor on another page with the WYSIWYG component Image shows a highlighted path of a page with the anchor suffix](/content/concordia/en/web/design/components/anchor/_jcr_content/content-main/grid_container_783254608/grid-container-parsys/image_1933605036.img.jpg/1619013606873.jpg)
Dos (optional section)
- When your link is set, test it. You may have to activate the page to ensure your anchor functions properly.
- Hyperlinks make a promise to your user; ensure the context of your content is clear so that someone landing at that anchor (perhaps mid-page) clearly understands where they are.
Don'ts (optional section)
- Don't use same-page anchors on relatively short pages that are simple to navigate.
- In general, avoid linking to an Anchor on another page because the change in context may confuse the visitor.
Need support?
The Web team is here to help.