Targets are a specific type of link that points to a place on the current web page, rather than a different webpage. The point on the page that is linked to is called an "anchor." The WYSIWYG editor makes it easy to make targets and anchors.
Example: Each "see all" link on the Drupal glossary is a target link that points to an anchor on the same page.
- Place your cursor where you want the target to go to. This is often a header or the beginning of a paragraph.
- Click the "Anchor" icon in the WYSIWYG editor. It looks like a ships anchor and is to the right of the link buttons.
- In the box that should pop up, enter the name of your anchor. An anchor's name should be concise, unique, and meaningful.
- Click Insert. You should now see a small anchor icon next to your cursor.
- Now select the text that will link to the anchor.
- Click the link button in the WYSIWYG editor.
- In the link URL field, enter "#" and then the anchor name you selected earlier (e.g. "#event-sponsors").
- To link to an anchor on a new page, make a normal link and then append the #targetname to it. To use the above example, the link might be "/academic/russian/events/russian-table#event-sponsors".
- Save your work and test the link. When you click it, your browser should jump up or down the page to display the anchor's location (the anchor itself is invisible).
When Not to Use an Target/Anchor
Targets and anchors are only useful on long pages (at least three screens long). If a short page has anchors, it may only confuse the site user.
Targets may also be used when a better solution would be using headers to make the page more "scannable" or spreading the content across multiple pages.