Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Numinix MediaWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Help/Links
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Piped links == <!--T:158--> </translate> <translate><!--T:159--> A '''piped link''' is an internal [[<tvar name=1>Special:MyLanguage/Help:Link</tvar>|link]] or [[<tvar name=2>Special:MyLanguage/Help:Interwiki linking</tvar>|interwiki link]] where the 'target page name' of the link and its 'label' are both specified.</translate> <translate><!--T:160--> This is useful in cases where the user wants values of 'target page name' and 'label' to be different.</translate> <translate><!--T:161--> This also enables linking a contextually relevant word or phrase within the text of a page rather than using the generic value "see also".</translate> <translate><!--T:162--> The wording does not need to match the name of the target page.</translate> <translate><!--T:163--> Depending on the [[<tvar name=1>Special:MyLanguage/Help:Preferences</tvar>|preferences]] set for the current user and a supported browser, you can still see the link target: when you hover your cursor over the link, the name shows up in a pop-up window and is also shown in the status bar.</translate> <translate> <!--T:164--> For example: </translate> <pre><nowiki>[[coffeehouse setup|Get Piping Hot Coffee Here!]]</nowiki></pre> <translate><!--T:347--> will show:</translate> [[coffeehouse setup|Get Piping Hot Coffee Here!]] <translate><!--T:165--> Let's take another example: <nowiki>[[help:Piped link|piped link]]</nowiki> will be displayed as [[help:Piped link|piped link]].</translate> <translate><!--T:166--> This can be done when context makes it clear that the page being linked to is in the help namespace.</translate> <translate><!--T:167--> The piped link is a better way of doing this, rather than mistakenly linking to [[piped link]] which might be a disambiguation page or not exist.</translate> <translate><!--T:168--> Fun Fact: The term ''piped'' refers to the use of the pipe character "<tvar name="1">|</tvar>", which in this context is used to separate the more descriptive description from the actual name of the linked page.</translate> <translate><!--T:169--> The Pipe character was named after an alternative use of it; see [[w:en:Pipe (computing)|Pipe (computing)]].</translate> <translate> ===Using a redirect as an alternative=== <!--T:170--> </translate> <translate><!--T:171--> An alternative way is to use [[<tvar name=1>Special:MyLanguage/Help:Redirect</tvar>|redirect pages]].</translate> <translate><!--T:172--> To create <tvar name="1">[[Get Piping Hot Coffee Here!]]</tvar>, use <tvar name="2"><nowiki>[[Get Piping Hot Coffee Here!]]</nowiki></tvar> and make it redirect to [[coffeehouse setup]] (please note: unlike above, what pops up when you point at the link, depending on your browser's support, is the text that is already shown).</translate> <translate><!--T:173--> It is convenient if the redirect is already there or will also be of use elsewhere. However, there are a few drawbacks.</translate> *<translate><!--T:174--> the popup does not show the destination page</translate> *<translate><!--T:175--> "[[<tvar name=1>Special:MyLanguage/Help:Related changes</tvar>|Related changes]]" shows the changes in the ''redirect page'' not the redirect target</translate> *<translate><!--T:176--> the redirect message that is shown on the target page slightly clutters it</translate> <translate><!--T:177--> Using a piped link and a redirect together, it is possible to provide information in the hover box that is not the name of the linked page, for example, the value of a unit in terms of other units.</translate> <translate><!--T:178--> In that case, it is possible to make a page whose page name is the information that you'd like in the link title, and which redirects to the page with a more appropriate name.</translate> <translate><!--T:179--> For example, the page [[w:30.48 cm]] redirects to [[w:Foot (unit)]].</translate> <translate> ===Pipe trick=== <!--T:180--> <!--T:181--> If the part after the <tvar name=2><code>|</code></tvar> in a piped link is left empty, it is to an abbreviated form of the page name on the left, based on the following rules: </translate> #<translate><!--T:182--> Any word that is before the '''first colon (:)''', as well as the colon character itself, is removed.</translate> <translate><!--T:183--> This word may or may not be a 'namespace' prefix (such as "Help:") or an 'interwiki' prefix (such as "commons:").</translate> <translate><!--T:184--> If the name of the page is preceded by a colon (:), "first" refers to "first after this".</translate> #<translate><!--T:185--> If there is some text in the '''parentheses''' at the end, then it will be removed.</translate> #<translate><!--T:186--> If there are no parentheses, but there is a '''comma''' (,) character, the comma and everything after it is removed.</translate> #<translate><!--T:187--> Note that this does not work for '''sections/anchors''' as <tvar name="1"><code><nowiki>[[Help:Piped_link#Pipe_trick|]]</nowiki></code></tvar> outputs <tvar name="2">[[Help:Piped_link#Pipe_trick|]].</tvar></translate> <translate> <!--T:188--> Similar to using the three or four tildes when signing on Talk pages, and using 'subst', in a preview, the result shows up in the preview itself, but the conversion in the edit box is not shown yet. Click on the <tvar name=1><code></code></tvar> option to see the change in the wikitext. =====Examples===== <!--T:189--> </translate> * <translate><!--T:190--> <tvar name=1><code><nowiki>[[Help:Template|]]</nowiki></code></tvar> is converted to <tvar name=2><nowiki>[[Help:Template|Template]]</nowiki></tvar>, which is shown as <tvar name=3>[[Help:Template|Template]]</tvar></translate> * <translate><!--T:191--> <tvar name="1"><code><nowiki>[[Music: My life|]]</nowiki></code></tvar> is converted to <tvar name="2"><nowiki>[[Music: My life| My life]]</nowiki></tvar>, which is shown as <tvar name="3">[[Music: My life| My life]]</tvar> - although "Music:" itself is not a namespace (therefore the space after the colon character is not automatically removed), however, the shortcut works anyway</translate> * <translate><!--T:192--> <tvar name="1"><code><nowiki>[[w:en:Pipe (computing)|]]</nowiki></code></tvar> is converted to <tvar name="2"><nowiki>[[w:en:Pipe (computing)|en:Pipe]]</nowiki></tvar>, which is shown as <tvar name="3">[[w:en:Pipe (computing)|en:Pipe]]</tvar>.</translate> * <translate><!--T:193--> <tvar name="1"><code><nowiki>[[commons:Boston, Massachusetts|]]</nowiki></code></tvar> is converted to <tvar name="2"><nowiki>[[commons:Boston, Massachusetts|Boston]]</nowiki></tvar>, which is shown as <tvar name="3">[[commons:Boston, Massachusetts|Boston]]</tvar>.</translate> *<translate><!--T:194--> <tvar name="1"><code><nowiki>[[w:}|]]</nowiki></code></tvar> ''does not'' give <tvar name="2"><nowiki>[[w:}|}]]</nowiki></tvar>, and calling the template with a value of parameter 1 gives a working link, but in the case of substitution only.</translate> *<translate><!--T:195--> <tvar name="1"><code><nowiki>[[w:en:|]]</nowiki></code></tvar> ''does not'' give <tvar name="2"><nowiki>[[w:en:|en:]]</nowiki></tvar> and <tvar name="3"><code><nowiki>[[m:|]]</nowiki></code></tvar> ''does not'' give <tvar name="4"><nowiki>[[m:|]]</nowiki></tvar></translate> *<translate><!--T:196--> <tvar name="1"><code>[[Wikipedia:Village pump (technical)#Pipe trick|]]</code></tvar> is not converted, so it does not give a working link.</translate> {| | <translate><!--T:197--> This wikitext</translate> | <translate><!--T:198--> Produces</translate> |- | <syntaxhighlight lang="wikitext"> * [[project:a (b)|a]] * [[w:project:a (b)|project:a]] * [[:de:project:a (b)|project:a]] * [[wiktionary:project:a (b)|project:a]] * [[wiktionary:de:project:a (b)|de:project:a]] * [[wikibooks:project:a (b)|project:a]] * [[wikiquote:project:a (b)|project:a]] * [[wikisource:project:a (b)|project:a]] * [[wikisource:project:a (b)#c|]] * [[w:en:|en:]] [[w:en:|en:]] * [[m:|m:]] [[m:|m:]] </syntaxhighlight> | * [[project:a (b)|a]] * [[w:project:a (b)|project:a]] * [[:de:project:a (b)|project:a]] * [[wiktionary:project:a (b)|project:a]] * [[wiktionary:de:project:a (b)|de:project:a]] * [[wikibooks:project:a (b)|project:a]] * [[wikiquote:project:a (b)|project:a]] * [[wikisource:project:a (b)|project:a]] * [[wikisource:project:a (b)#c|]] * [[w:en:|en:]] [[w:en:|en:]] * [[m:|m:]] [[m:|m:]] |} <translate> =====Category tag===== <!--T:199--> <!--T:200--> Since the sortkey syntax of the category is similar to a piped link, the pipe trick also works for category tags, even though technically, it is not useful there. ====Limitation==== <!--T:201--> </translate> * <translate><!--T:202--> <tvar name="1"><nowiki>[[Help:Lk|]]</nowiki></tvar> using <tvar name="2">[[template:tc]]</tvar> is not converted, so the result is rendered as <tvar name="3">[[Help:Lk|Lk]]</tvar> which is not as a working link.</translate> <translate><!--T:203--> This is because like substitution, the pipe trick expansion occurs before ordinary expansion of the templates, etc.</translate> <translate><!--T:204--> The pipe trick does not work if the linked page includes invalid characters.</translate> <translate><!--T:205--> Therefore, while ordinarily the acceptability of the target page name is assessed after template expansion, the pipe trick expansion judges it before that.</translate> <translate><!--T:206--> The braces are therefore considered invalid characters in the page name.</translate> <translate><!--T:207--> Instead, a template can be used like <tvar name="1">[[template:pipe trick]]</tvar>: <tvar name="2"><nowiki>k}}</nowiki></tvar> which renders as <tvar name="3">k}}</tvar>.</translate> <translate> ====Inverse pipe trick==== <!--T:208--> <!--T:209--> On page "<tvar name="1">A (c)</tvar>", <tvar name="2"><nowiki>[[|b]]</nowiki></tvar> is converted to <tvar name="3"><nowiki>[[b (c)|b]]</nowiki></tvar> automatically. <!--T:210--> Similarly, on page "<tvar name="1">A, c</tvar>", <tvar name="2"><nowiki>[[|b]]</nowiki></tvar> is converted to <tvar name="3"><nowiki>[[b, c|b]]</nowiki></tvar> automatically.
Summary:
Please note that all contributions to Numinix MediaWiki Demo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)