Help:Link
From Sunshine Review
| Sunshine Review Projects | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
Contents |
[edit] Wikilinks
A wikilink or internal link links a page to another page within the same project.
- [[a]] gives a.
- [[a|b]] gives b (link to a, labeled b).
- [[a]]b gives ab, just like [[a|ab]] does: ab.
- [[a|b]]c gives bc, just like [[a|bc]] does: bc.
- a[[b]] gives ab.
- [[a]]<nowiki>b</nowiki> gives ab.
- [[a]]''b'' gives ab.
- ''[[a]]''b gives ab.
- [[a|b]]c<nowiki>d</nowiki> gives bcd.
- [[a]][[b]] gives ab (two links, but looking equal to the single link ab), even if the links are underlined (a b and a b look the same only if links are not underlined).
Links with parameters (the link name) are said to be "piped" because of the pipe symbol used ( | ).
MediaWiki automatically checks if the target of a wikilink exists ("existence detection"). If the page doesn't exist, the link leads to the editing screen, and it is assigned the class "new". Such wikilinks are nicknamed "red links" because they are colored red in the default stylesheet on a default installation of MediaWiki. Red links are useful in determining the current status of the page (created or not created), create incoming links to a future page, facilitates and incites page creation.
Note that the image, category, and interlanguage syntax are the same as the wikilink syntax. Attempting to link normally will place the image on the page, add the page to the category and create an interlanguage link at the edge of the page. This can be prevented by prefixing a colon, which escapes the specific syntax. For example, [[:Category:Help]], [[:fr:Help:Link]], and [[:Image:Mediawiki.png]].
The existence of an internal link from a page to an existing or non-existing page is recorded in the pagelinks table.
[edit] Stub feature
A wikilink to an existing page will be in class 'stub' if the page is in the main namespace, it is not a redirect, and the number of bytes of the wikitext is less than the "threshold for stub display" set in the user's preferences.
This allows users to immediately identify links to very short pages that probably need to be expanded. Alternately, a user may set a very high threshold to achieve any of the following:
- Identify links to very large pages. However, the criterion is the size of the wikitext; possible inclusion of templates and images can make the rendered page large, even if the amount of wikitext is small.
- Determine at a glance whether a link leads to the main namespace or not. However, this does not take into account redirects to the main namespace (even if the redirect itself is in the main namespace).
- Identify links to redirects, for clean-up work such as bypassing redirects.
However, section linking to a "stub" does not work. Although this is normally a minor issue, this may cause problems with users who set a very high threshold.
[edit] Interwiki links
An interwiki link links a page to a page on another website. Unlike the name suggests, the target site need not be a wiki, but it has to be on the interwiki map specified for the source wiki. These links have the associated CSS class "extiw". These are in the same form as wikilinks above, but take a prefix which specifies the target site. For example, on Wikimedia projects and many other wikis [[Sunshine Review:Main Page]] links to Sunshine Review's main page. The prefix can be hidden using the same piped syntax as wikilinks.
[edit] Interwiki links to the same project
Although interwiki links can be used to point to a wiki from itself, this is not generally recommended. MediaWiki does not detect whether or not the target page of an interwiki list exists, so there is no special formatting and the link is always to the view page. Further, MediaWiki does not check if the page is linking to itself. A self wikilink is bolded (like Help:Link), whereas a self interwiki link is normal (m:Help:Link).
Pros:
- A copy of the wikitext on a sister project may still point to the same page. Sometimes two prefixes are needed for that purpose, e.g. w:de:a.
[edit] External links
External links are primarily used to cite sources for wiki article. Below is an example of the wiki syntax for an external link:
- [http:www.url.com ''Source'', Title, Date]
This article was taken from Wikipedia.
