Head-Fi.org › Site Tutorials › How To Create A Link To A Refererce Inside A Document

How To Create A Link To A Refererce Inside A Document

What you are reading is how to add an "anchor" to a post or wiki. There appears to be support in the "Link" tool for linking to an anchor but I couldn't find an easy way to insert an anchor into the document. A workaround for now is to insert an anchor using the "source" editor.

 

The HTML anchor tag requires two fields. The first field is an identifier (id="user_unique_anchor_name") and the second field ("My text label") is a label describing the reference. The format of an identifier must be contain the word "user_" followed by a document unique name (the name can be separated by underscores). The second field can be any group of characters. An anchor may be embedded into any part of the text or more commonly embedded into a document heading.

 

For example:

 

Basic anchor format:

    <a id="user_unique_anchor_name">My text label</a>

Anchor embedded into a heading 3:

<h3><strong><a id="user_create_new_data">Create New Data Heading 3</a></strong></h3>

Create a link to an anchor.

This is <a href="#user_my_unique_anchor_name">Link to anchor #1</a>

 

To link to an anchor you may use the built-in "Link" tool or embed the link by editing the HTML.

 

To use the built-in link tool click on the "Link" icon in the editor window. Change the protocol to "<other>" and type in the anchor name prefixed by a '#' sign (see below).

 

add_link.png

 

For a table of contents you could embed the tag into any of the "heading" fonts or within the document. See example below.

 


 

My table of contents

This is a Link to anchor #1

This is a Link to anchor #2

This is a Link to anchor #3

 

 

 

Anchor #1 heading

 

 

 

 

Anchor #2 Subheading

 

 

 

This is Anchor #3 embedded in text.

 


 

The HTML for this example.

 

<p>
    <u><strong>My table of contents</strong></u></p>
<p>
    This is a <u><a href="#user_anchor1">Link to anchor #1</a></u></p>
<p>
    This is a <u><a href="#user_anchor2">Link to anchor #2</a></u></p>
<p>
    This is a <u><a href="#user_anchor3">Link to anchor #3</a></u></p>
.
.
.
<h1>
    <a id="user_anchor1">Anchor #1 heading</a></h1>
.
.
.
<h2>
    <a id="user_anchor2">Anchor #2 Subheading</a></h2>
.
.
.
<p>
    This is <a id="user_anchor3">Anchor #3</a> embedded in text.</p>

 

Comments (2)

Thanks for this! It makes a complicated topic very easy to follow, works well for my Wiki.
Thank you, this is gonna be very useful, too bad is not available in the link pop up windows tho, It'd make it easier.
Head-Fi.org › Site Tutorials › How To Create A Link To A Refererce Inside A Document