Help:Link
Links are used to connect readers with other pages on the wiki or to other websites. Providing a link gives the reader one-click access to other resources and material, and allows readers to more easily find other pages and navigate around the wiki.
Wikilinks (internal links)[edit source]
A wikilink, or internal link, is a link to a different page on the same wiki. This can be accomplished by surrounding the text you want to link with double square brackets, [[like this]]
. For example, typing:
[[Main Page]]
- ...will display as:
The text will appear blue, and when clicked on, will direct you to the Main Page of the wiki. Similarly, [[The Sims 2]]
will display as The Sims 2, and link you to the page of the same name. If the name of the page you are linking to does not exist, the link will appear red when rendered, like this. This is known as a "redlink". When you click on the link, you will be taken to a page that will allow you to create the page.
By default, the linked text will always be the same as the page you are linking to. You can change this by using the vertical bar, or "pipe", symbol (|) within the link. For example, [[Main Page|Visit my homepage]]
will display as "Visit my homepage". Note that the first term before the vertical bar is the name of the page you are linking to, while the second term after the vertical bar is the text that is displayed. These kinds of links are sometimes known as "piped links".
The link target is case sensitive except for the first letter, so [[pleasantview]]
links to the same page as [[Pleasantview]]
, but [[pLeasantview
does not link to the same place. Underscores in the link are interpreted as spaces, so [[The_Sims_3]]
links to the same page as [[The Sims 3]]
.
If you try to link to the current page (called a "self-link"), the text will appear as bold text. For example, typing [[Help:Link]]
on this page will produce Help:Link. This is not the case with section links, which will be explained further down this page.
Description | You type | You get |
---|---|---|
Link to the page The Sims 2 | [[The Sims 2]] |
The Sims 2 |
Link to the page The Sims 2 with the text "A great game" being displayed | [[The Sims 2|A great game]] |
A great game |
Link targets are case sensitive except for the first letter | [[The Sims 2]] and [[the Sims 2]] link to the same page, but not [[THE Sims 2]] |
The Sims 2 and the Sims 2 link to the same page, but not THE Sims 2 |
Underscores are treated the same as spaces | [[The Sims 2]] and [[The_Sims_2]] link to the same page |
The Sims 2 and The_Sims_2 link to the same page |
Linking to the same page produces bold text instead | [[Help:Link]] |
Help:Link |
Blend links[edit source]
If the text you want to display contains the exact same words as the name of the linked page, you can save some time by using what is called "link blending" or "link trailing". For example, if you wanted to link to the page camera and wanted to display the text "cameras", you can simply type [[camera]]s
, which produces "cameras". This is equivalent to typing [[camera|cameras]]
.
Link trailing will follow all subsequent text that is placed after the closing brackets (]]
) and include them as part of the link. Link trailing stops when you add a space, a capital letter, or punctuation. To disable link trailing, you can add <nowiki />
after the closing brackets.
Description | You type | You get |
---|---|---|
Link trailing example | [[Camera]]s [[Help:Contents|Help]]ing |
Cameras |
Link trailing stops when it encounters a space, capital letter, or punctuation mark | [[Camera]]s are cool [[Help:Contents|Help]]ingStopshere [[Help:Contents|Help]]ing:stopshere |
Cameras are cool
HelpingStopshere Helping:stopshere |
Disable link trailing | [[Help:Contents|Help]]<nowiki />ing |
Helping |
Pipe trick[edit source]
The "pipe trick" is a technique that can allow you to quickly fill the displayed text field for a piped link. This is done by writing a link like you normally would, but simply ending the link with a pipe rather than with the displayed text, like this: [[linked page|]]
.
When this is done, the displayed text will automatically be generated when the 'Publish changes' button is clicked. This text will automatically remove any text in parenthesis, text that comes after the first comma, and text that comes before the first colon.
You type | You get |
---|---|
[[The Sims 3 (console)|]] |
|
[[Pleasantview, Strangetown, and Melbourne|]] |
|
[[The Sims 2: Nightlife|]] |
|
If the linked page contains both commas and a final parenthesis, only the parenthesis is removed.
You type | You get |
---|---|
[[Yours, Mine and Ours (1968 film)|]] |
|
The pipe trick does not work in edit summaries, within <ref></ref>
or <gallery></gallery>
tags, or in section links.
Linking to files and categories[edit source]
If you want to link to a file or category page, you will need to add a colon to the start of the link in order to prevent it from actually adding the file or category to the page. For example, [[:File:Example.jpg]]
or [[:Category:Example]]
.
Section links[edit source]
- See also: Help:Section
To link to a specific section on a page, append a #
and the section name to the link, like so:
[[Page name#Section name|Displayed text]]
Sections are usually created by using headings. Creating a heading will automatically create what is known as an "HTML anchor" of the same name as the heading. For example:
You type | You get |
---|---|
== Geography == |
|
You can link to this section by typing [[Name of page#Geography]]
.
You can also create an HTML anchor in any location on the page without having to create a heading through the use of the {{Anchor}} template. For example, typing:
{{Anchor|Economy}}
...will not produce any visible output, but you can link to that part of the page by typing [[Name of page#Economy]]
.
If you are linking to a section on the same page, you can omit the Name of page parameter and just type [[#Section name]]
. For example, [[#Geography]]
.
If there are multiple sections with the same name, append a "_2" when linking to the second section with the same name, a "_3" for the third, and so forth. For example, [[Name of page#Geography_2]]
, [[Name of page#Geography_3]]
, and so forth.
External links[edit source]
External links are used to link to other websites. To link to another website, you will need to provide the full URL of the web page you want to link to. External links are enclosed using a single square bracket, rather than double for wikilinks, and the displayed text for the link is separated by a space, not a pipe.
You type | You get |
---|---|
[http://www.example.com Link to Example.com] |
|
http://
or https://
, in order for the link to work. If you are copying and pasting from your browser's address bar, or by right-clicking a link and selecting "Copy link address", then the protocol should automatically be included. Simply typing [www.example.com Link to Example.com]
does not work; you must type something like [http://www.example.com Link to Example.com]
.If you do not provide a text to be displayed and simply surround the URL with square brackets, the link will appear numbered, in the order of other unnamed external links. The first unnamed external link will be numbered "1", and the second "2", and so forth. External links that are named are not included in this count.
You type | You get |
---|---|
[http://www.example.org/some-page][http://www.example.org/some-other-page] |
|
If you simply paste a URL into the text, it is automatically converted into a clickable link. Try to avoid doing this, as it is considered bad form.
You type | You get |
---|---|
https://www.miraheze.org/ |
|
Plain links[edit source]
External links will have an external link icon following them by default. If desired, you can disable this icon by surrounding the link with <span class="plainlinks"> ... </span>
tags.
You type | You get |
---|---|
[http://www.example.org/some-page A page] <span class="plainlinks">[http://www.example.org/some-page A page]</span> |
|
URL protocols[edit source]
You can use a number of other different URL protocols, or URI schemes. The most common ones are http://
and https://
, which are used to link to webpages. The software supports a number of other different protocols. These can range from automatically opening one's own email program when they click on an email address to linking to Bitcoin addresses or even torrent download links. These are formatted in a similar fashion to other external links. For example, to create a link that allows people to email johnexample.com, you can type [mailto:john@example.com Email John]
, which will produce: Email John.
The following protocols are supported:
- bitcoin:
- ftp://
- ftps://
- geo:
- git://
- gopher://
- http://
- https://
- irc://
- ircs://
- magnet:
- mailto:
- mms://
- news:
- nntp://
- redis://
- sftp://
- sip:
- sips:
- sms:
- ssh://
- svn://
- tel:
- telnet://
- urn:
- worldwind://
- xmpp:
Interwiki links[edit source]
An interwiki link is a link that is formatted like a regular wikilink, but points to another wiki or website rather than within The Sims Wiki. These can make it easier to link to a select list of websites, including all other wikis on Miraheze, without having to use the external link syntax.
For example, when linking to Wikipedia, instead of writing [https://en.wikipedia.org/wiki/Sunflower Sunflower]
, you can simply write [[wikipedia:Sunflower|Sunflower]]
. When the edit is published, the link will not contain the external link icon and will otherwise look like a normal link, except that it will link to Wikipedia rather than to another page on The Sims Wiki.
You can also use interwiki links to quickly link to other wikis on Miraheze. The syntax is [[mh:wiki prefix:name of page]]
. The wiki prefix is the part that comes before miraheze.org
in your address bar. On The Sims Wiki, the wiki prefix is sims
, so if you were on another wiki on Miraheze, and you wanted to link to the "The Sims 2" page, you would write: [[mh:sims:The Sims 2]]
. You can also link to just the main page of the wiki by excluding the last part. For example, [[mh:sims]]
.
Below is a list of some of the most commonly used interwiki prefixes.
Prefix | Description | Usage |
---|---|---|
c | Wikimedia Commons | [[c:page name]]
|
d | Wikidata | [[d:page name]]
|
doi | DOI lookup | [[doi:DOI code]]
|
Google search | [[g:search terms]]
| |
imdb | Internet Movie Database | [[imdb:page name]]
|
m | Meta Wiki on Miraheze | [[m:page name]]
|
mediazilla | Phabricator for Wikimedia | [[mediazilla:page name]]
|
metawikimedia | Meta Wiki on Wikimedia | [[metawikimedia:page name]]
|
mh | Miraheze | [[mh:wiki prefix:page name]]
|
mw | MediaWiki.org | [[mw:page name]]
|
phab | Phabricator for Miraheze | [[phab:page name]]
|
rfc | IETF RFCs | [[rfc:RFC number]]
|
shoutwiki | ShoutWiki | [[shoutwiki:]] (for home page)
|
translatewiki | translatewiki.net | [[translatewiki:page name]]
|
wikia | Wikia | [[wikia:wiki prefix]] (for linking to a specific wiki)
|
wikipedia | Wikipedia (default English Wikipedia) | [[wikipedia:]] (for the Main Page of the English Wikipedia)
|
wikiquote | Wikiquote (default English Wikiquote) | [[wikiquote:]] (for the Main Page of the English Wikiquote)
|
wikisource | Wikisource (default English Wikisource) | [[wikisource:]] (for the Main Page of the English Wikisource)
|
wikt | Wiktionary (default English Wiktionary) | [[wikt:]] (for the Main Page of the English Wiktionary)
|
A complete list of interwiki links can be found here.
Interlanguage links[edit source]
An interlanguage link is a link that points readers to another language edition of The Sims Wiki. Unlike other links, interlanguage links are not shown in the body of the article, but on the sidebar. They are typically used to connect different language versions of the currently-viewed page with each other.
Before interlanguage links can be set up, the two wikis must be linked to allow for interlanguage links. This can be done by requesting at the stewards' noticeboard on Meta. Once this is done, typing [[language code:page name]]
on either of the two wikis will create an interlanguage link pointing to the other wiki on the sidebar. For example, if the current page was named "Plankton", interlanguage links to different language wikis would look something like this:
[[de:Plankton]] [[es:Plancton]] [[fr:Plancton]] [[ru:Планктон]]
Interlanguage links are typically placed at the bottom of the page, in order to make it easier to organize them.
Advanced[edit source]
Protocol-relative URLs[edit source]
The MediaWiki software that runs The Sims Wiki supports protocol-relative URLs that do not have a URI protocol at the beginning. By default, they will use the protocol that is currently being used on the page. This was originally used in the past prior to the widespread adoption of HTTPS in order to ensure that users remained on the HTTP or HTTPS version of the website without being accidentally redirected to the other. As Miraheze uses HTTPS on all of its wikis by default, this type of URL formatting should generally not be used.
Description | You type | You get |
---|---|---|
Using a protocol-relative URL for example.com. The URL will begin with |
[//www.example.com] |
[3] |
Protocol-relative URLs do not work if the URL is not surrounded by square brackets. | //www.example.com |
//www.example.com |
External links to internal pages[edit source]
It is not possible to create a regular wikilink to many dynamically generated pages on The Sims Wiki. For example, www.thesimswiki.com/wiki/Help:Link?action=edit
cannot be linked to; attempting to write [[Help:Link?action=edit]]
will take you to the wrong page. This is because these URLs contain query parameters, like ?action=edit
and &action=edit
. These contain the characters ?
and &
which have special meanings in URLs. If you try to wikilink them, the software will automatically encode them into %3F
and %26
so that the link will take you to the page titles containing those characters, rather than to the edit window.
To link to pages with query parameters, for instance to create an "Edit" button that users can click on to edit the page, you will need to use external link syntax. For example, [https://www.thesimswiki.com/wiki/Help:Link?action=edit Edit this page]
will work correctly.
If you are linking to a page within The Sims Wiki, there is a better alternative: use the fullurl
magic word. For example, [{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]
creates a link to edit the current page.
Subpage links[edit source]
If you are linking to a subpage of the current page, you can shorten the link by simply typing [[/name of subpage]]
. For example, on the current page (Help:Link), you can create a link to Help:Link/example by typing [[/example]]
. This is the equivalent of typing [[Help:Link/example]]
.
You type | You get |
---|---|
[[/example]] |
|
[[/example/]] |
|
[[/example|Subpage link]] |
|
If you are currently editing a subpage, this syntax works for linking to subpages of the current subpage. You can employ similar syntax to link back to the "parent" page.
Description | You type |
---|---|
Links to the parent of the current subpage. For example, if you were on page Help:Link/example/another, it would link to Help:Link/example. | [[../]] |
Links to the grandparent of the current subpage. For example, if you were on page Help:Link/example/another, it would link to Help:Link. | [[../../]] |
Links to a sibling of the current subpage. For example, if you were on page Help:Link/example/another, and you typed [[../whatever]] , it would link to Help:Link/example/whatever.
|
[[../x]] |
Links to an uncle of the current subpage. For example, if you were on page Help:Link/example/another, and you typed [[../../preview]] , it would link to Help:Link/preview.
|
[[../../x]] |
Be careful when using subpage links like the one above, as they will break if you move the page to a different title. Subpage links are best used in situations where the page titles are not going to be changed often, or if they are changed, all other subpages would be moved appropriately. Subpage links can also confuse inexperienced editors. When in doubt, it never hurts to simply write out the full page name.
See also[edit source]
- Help:Links on MediaWiki.org
- Help:Link on English Wikipedia
- Help:Pipe trick on English Wikipedia
- Help:Colon trick on English Wikipedia
- Help:Link on Meta Wikimedia