Help:Index/Formatting/Links/Internal

Internal links are redirects (or hyper-links) to pages within the Citizendium.

Internal links are the easiest create. In the editor, simply highlight a word or phrase and push the "Ab" button above the editor window. This automatically makes the highlighted text an internal link. Internal links are identified in the code by two square brackets:. You can simply type the brackets in instead of using the highlighting method.

Examples:


 * This code:  looks like: Biology
 * This code:  looks like: CZ:External Links

Piping
Sometimes you may want link pages using words other than the page's name. For example, suppose that you want to link to the page CZ:External Links. But when writing a your text you may want to say something like "I didn't know where to look." You can do this by separating the page name with a vertical line or "pipe": "|" For example:

Example:
 * This code:  looks like:  I didn't know where to look

Connecting links in this way is called "piping." Links created this way are called "piped links."

Red Links
If the link connects to an existing page on the Citizendium, the link will show up blue. If the link is to a page that does not yet exist, it will show as red. These are sometimes called "red links."

Example:
 * This code:  looks like: CZ:ZZZ

Creating Pages Using Links
You can create new pages by creating red links, following the link, and editing the page.

Links to Sections
It is possible to link to a specific section on a page. To do this, write two square brackets, followed by the page name, followed by a hash sign. The page name can be omitted if you want to link to a section on the same page. You will usually want to combine this with a piped link.

Example:
 * This code:  looks like: CZ:External Links
 * This code:  looks like: Guidelines for annotations of external links
 * This code:  looks like:
 * This code:  looks like: CZ:External Links

The section name must use exactly the same punctuation, capitalization and spelling. If the name does not match, then you won't get a red link, but the link will simply point to the top of the page as if no section name were specific (see the last example).

This causes a problem. Suppose that somebody changes the name of a section "Guidelines for annotations" on CZ:External Links. This will break the link CZ:External Links, but there is no way to find this out. To prevent this, you should write a HTML comment in the section you're linking to. For instance, the code for the section "Guidelines for annotations" on CZ:External Links starts as follows:



When changing the name of a section with such a comment, you should go to the page mentioned in the comment and also change the section name in the links that point at that section.

Links to Arbitrary Places on a Page
It is even possible to link to an arbitrary location on a page. For instance, the link goes to the examples of section links. If you want to do this, you have to place a special code at the place you are linking to (this special code is called an anchor). This special code looks as follows:



Replace the dots with the name that you want to give to the anchor. This is the name that you use in the link instead of the section name. For example, the code for the examples of section links starts with



This code creates an anchor with the name "section-example", thus indicating where the link links to.