Help:Contributing/links

From Wikibase
Jump to navigation Jump to search

Languages: English · français · Esperanto

Links connect the pages of this wiki to each other and to the outside world. This page covers the link syntax you will use day to day: internal links, links to sections, external links and interwiki shortcuts.

A wikilink points to another page on this wiki. Write the page title inside double square brackets.

What you want What you type What you get
Link to a page [[Main Page]] Main Page
Link with your own label — the part after the pipe is shown [[Help:Contributing|the contributor hub]] the contributor hub
Link to an item — entity pages are ordinary pages here [[Item:Q162|Blue Marble (photograph)]] Blue Marble (photograph)
Link to a property [[Property:P1|instance of]] instance of
Link to a page that does not exist — a red link [[My new page]] My new page

Following a red link opens the editor for that page: a red link is an invitation to create the page.

The first letter of the target is not case-sensitive — [[main Page]] and [[Main Page]] are the same link. Every later letter must match the page title exactly: [[Item:q162]] is a red link, not the item. Spaces in a title are interchangeable with underscores.

Linking to the page you are editing renders as bold text, not as a link.

Prefer an internal link whenever the target lives on this wiki. A red link invites someone to create the page; an external link to the same page does not.

A piped link with an empty label shows an abbreviated title — the namespace is dropped: [[Item:Q162|]] shows Q162.

To make one title an alias of another, put #REDIRECT [[Main Page]] as the first line of the page — it then redirects to the target. See Help:Redirects (official).

Every heading is an automatic anchor, so a link can point straight at a section.

What you want What you type What you get
A section on another page [[Help:Contributing/code#House rules|house rules]] house rules
A section on the same page [[#See also|jump to the end]] jump to the end
The top of the page [[#top|back to top]] back to top

The anchor is the heading text as written: if the heading is renamed, links to that section break.

External links point to other websites. The URL comes first, the label after, inside single square brackets.

What you want What you type What you get
Labelled link [https://www.mediawiki.org MediaWiki] MediaWiki
Bare URL — linked automatically, no brackets needed https://www.mediawiki.org https://www.mediawiki.org
No label — numbered automatically [https://www.mediawiki.org] [1]

The URL and its label must stay on one line: a line break inside the brackets breaks the link, and the [ shows up literally.

External links carry a small arrow icon to show they leave this wiki.

Interwiki links are shortcuts to other wikis, written like internal links with a prefix. This wiki comes with the standard prefixes: wikipedia, wikidata, commons, mw, and more.

What you want What you type What you get
A Wikipedia article [[wikipedia:Sunflower|sunflower]] sunflower
A Wikidata item [[wikidata:Q42|Q42]] Q42
A MediaWiki help page [[mw:Help:Links|MediaWiki help]] MediaWiki help

Remote pages always render blue — interwiki links do not check whether the target page exists on the other wiki. The full list of prefixes is on Special:Interwiki.

The language versions of this wiki's pages are linked with the {{Languages}} bar, not interlanguage markup — see Languages and translation.

Files and categories

A leading colon makes a file or category link visible as text instead of performing its action.

What you want What you type What you get
A text link to a file page [[:File:Example.png|Example.png]] Example.png
A text link to a category [[:Category:HowItWorks]] Category:HowItWorks

Without the colon, [[File:…]] embeds the file and [[Category:…]] is treated as a plain page under the Category namespace.

Embedding images and media is covered in Help:Contributing/richMediaContent.

Markdown syntax does not work with wikis

  • Internal links is: [[Page title]], not [text](url).
  • External links is [https://example.com label], not [label](https://example.com).

See also