Help:Links

From Avon Lake Wiki
Jump to: navigation, search

There are four main types of links in MediaWiki:

  1. Internal links to other pages in the wiki
  2. External links to other websites
  3. External links to internal pages in the wiki

Internal links

To add an internal link, enclose the name of the page you want to link to in double square brackets. When you save the page, you'll see the new link pointing to your page. If the page exists already it is displayed in blue, if it does not, in red. Selflinks to the current page are not transformed in URLs but displayed in bold. (If you really want to link to the current page, use an anchor (see below), or [[#top|current page]] which always links to the top.) The first letter of the target page is automatically capitalized, unless otherwise set by the admins, and spaces are represented as underscores (typing an underscore in the link will have a similar effect as typing a space, but is not recommended, since the underscore will also be shown in the text).

Description You type You get
Internal link
[[Main Page]]

[[Category:Help]]
Main Page
Piped link
[[Main Page|different text]]

[[Main Page|different text2]]
different text

different text2

Internal link to an anchor
[[#See also]]

Section headings and the top of the page are automatically anchored.

#See also
Setting an internal link anchor
<div id="NameOfAnchorHere">optional text</div>

Omit the "optional text" for invisible anchor.

optional text
Internal link to an anchor at another page
[[Help:Creating New Pages#Using Wikilinks]]
Help:Creating New Pages#Using Wikilinks
Internal link to a subpage
[[/example]]

Shortcut for [[Help:Links/example|/example]]. See also [[<tvar|subpages>Special:MyLanguage/Help:Subpages</>|Help:Subpages]].

/example
Internal link to a category page
[[:Category:Help]]

See also Help:Categories

Category:Help
Internal link to an image or a file of other types
[[media:example.jpg]]

Linking directly to a file page without creating a thumbnail is done by the following syntax:

[[:File:example.pdf]]

See also Help:Images

media:example.jpg





File:example.pdf



Internal link to the user's user page
[[Special:MyPage]]
Special:MyPage

External links

To add an external link, enclose the URL followed by space and the name of the page you want to link to in single square brackets. When you save the page, you'll see the new link pointing to your page, with an arrow icon after it to show that it was coded with single bracket external link syntax, and thus may lead to another site.

Description You type You get
External link
https://en.wikipedia.org
https://en.wikipedia.org
External link with different label
[https://en.wikipedia.org Wikipedia]
Wikipedia
Numbered external link
[https://mediawiki.org]
[1]
External links with file icons
[https://en.wikipedia.org/wiki/.avi video]

[https://en.wikipedia.org/wiki/.ogg sound]

[https://en.wikipedia.org/wiki/.pdf document]
video

sound
document

Mailto link
[mailto:info@example.org email me]
email me

External links to internal pages

To add a link to a page on the same wiki using URL query parameters, you may need to use external link syntax.

Description You type You get
External link to the current page's edit page
[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]
Edit this page
External link to the current page's edit page, and styled to look like an internal link
<span class="plainlinks">[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</span>

These plainlinks can be used in cases where you want an external link to look like an internal one, by suppressing the icon that normally appears after it.

Edit this page

How to avoid auto-links

When you put a URL on a wiki page, it will be automatically converted into an external link, like this:

https://mediawiki.org

To avoid that effect, put the URL between <tvar|1><nowiki></> tags, like this:

<nowiki>https://mediawiki.org</nowiki>

To get this:

https://mediawiki.org