「ヘルプ:Links」の版間の差分
(default links) |
細 (1版 をインポートしました) |
||
(10人の利用者による、間の32版が非表示) | |||
1行目: | 1行目: | ||
+ | <languages/> | ||
{{TNT|PD Help Page}} | {{TNT|PD Help Page}} | ||
− | |||
<translate> | <translate> | ||
+ | <!--T:1--> | ||
There are five types of links in MediaWiki: | There are five types of links in MediaWiki: | ||
− | # '''[[#Internal links|Internal links]]''' to other pages in the wiki | + | <!--T:2--> |
− | # '''[[#External links|External links]]''' to other websites | + | # '''[[<tvar|internal>#Internal links</>|Internal links]]''' to other pages in the wiki |
− | # '''[[#External links to internal pages|External links to internal pages]]''' in the wiki | + | # '''[[<tvar|external>#External links</>|External links]]''' to other websites |
− | # '''[[#Interwiki links|Interwiki links]]''' to other websites registered to the wiki in advance | + | # '''[[<tvar|external2>#External links to internal pages</>|External links to internal pages]]''' in the wiki |
− | # '''[[#Interlanguage links|Interlanguage links]]''' to other websites registered as other language versions of the wiki | + | # '''[[<tvar|interwiki>#Interwiki links</>|Interwiki links]]''' to other websites registered to the wiki in advance |
+ | # '''[[<tvar|interlang>#Interlanguage links</>|Interlanguage links]]''' to other websites registered as other language versions of the wiki</translate> | ||
− | == Internal links == | + | {{Anchor|Internal|Internal links}} |
+ | <translate> | ||
+ | == Internal links == <!--T:3--> | ||
+ | <!--T:4--> | ||
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. | 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. | 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 <nowiki>[[#top|current page]]</nowiki> which always links to the top.) | + | (If you really want to link to the current page, use an anchor (see below), or <code><nowiki>[[#top|current page]]</nowiki></code> which always links to the top.) |
+ | <!--T:5--> | ||
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). | 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). | ||
21行目: | 27行目: | ||
{| border="1" class="wikitable" | {| border="1" class="wikitable" | ||
− | !<translate>Description</translate> | + | !<translate><!--T:6--> |
− | !<translate>You type</translate> | + | Description</translate> |
− | !<translate>You get</translate> | + | !<translate><!--T:7--> |
+ | You type</translate> | ||
+ | !<translate><!--T:8--> | ||
+ | You get</translate> | ||
|- | |- | ||
− | |<translate>Internal link</translate> | + | |<translate><!--T:9--> |
− | |<pre>[[Main Page]]</pre> | + | Internal link</translate> |
+ | |<pre> | ||
+ | [[Main Page]] | ||
+ | |||
+ | [[Help:Contents]] | ||
+ | |||
+ | [[Extension:DynamicPageList (Wikimedia)]] | ||
+ | </pre> | ||
|[[Main Page]] | |[[Main Page]] | ||
+ | |||
+ | [[Help:Contents]] | ||
+ | |||
+ | [[Extension:DynamicPageList (Wikimedia)]] | ||
|- | |- | ||
− | |<translate>Piped link</translate> | + | |<translate><!--T:10--> |
− | |<pre>[[Main Page|different text]]</pre> | + | Piped link</translate> |
− | <translate>See also | + | |<pre>[[Main Page|different text]] |
+ | |||
+ | [[Main Page#Concrete_Paragraph|different text2]]</pre> | ||
+ | <translate><!--T:11--> | ||
+ | See also [[<tvar|meta>meta:Special:MyLanguage/Help:Piped link</>|meta:Help:Piped link]]</translate> | ||
|[[Main Page|different text]] | |[[Main Page|different text]] | ||
+ | |||
+ | [[Main Page#Concrete_Paragraph|different text2]] | ||
|- | |- | ||
|[[w:Help:Pipe_trick|Pipe trick]] | |[[w:Help:Pipe_trick|Pipe trick]] | ||
44行目: | 70行目: | ||
[[Extension:DynamicPageList (third-party)|]] | [[Extension:DynamicPageList (third-party)|]] | ||
</pre> | </pre> | ||
− | <translate>The pipe trick quickly makes shorter link text, but could be confusing in circumstances like the DynamicPageList link examples.</translate> | + | <translate><!--T:12--> |
+ | The pipe trick quickly makes shorter link text, but could be confusing in circumstances like the DynamicPageList link examples.</translate> | ||
|[[Help:Contents|Contents]] | |[[Help:Contents|Contents]] | ||
53行目: | 80行目: | ||
[[Extension:DynamicPageList (third-party)|DynamicPageList]] | [[Extension:DynamicPageList (third-party)|DynamicPageList]] | ||
|- | |- | ||
− | |<span id="linktrail"></span><translate>Word-ending links, following so called "linktrail rules" [[Localisation|localised]] per [[MessagesXx.php|each language]]</translate> | + | |<span id="linktrail"></span><translate><!--T:13--> |
+ | Word-ending links, following so called "linktrail rules" [[Localisation|localised]] per [[MessagesXx.php|each language]]</translate> | ||
|<pre> | |<pre> | ||
[[Help]]s | [[Help]]s | ||
72行目: | 100行目: | ||
[[Help]]almostanylettersyoulikehere | [[Help]]almostanylettersyoulikehere | ||
|- | |- | ||
− | |<translate>Avoiding word-ending links</translate> | + | |<translate><!--T:14--> |
+ | Avoiding word-ending links</translate> | ||
|<pre> | |<pre> | ||
[[Help]]<nowiki />ful advice | [[Help]]<nowiki />ful advice | ||
83行目: | 112行目: | ||
[[wikipedia:GNU General Public License|GPL]]<nowiki />v3 | [[wikipedia:GNU General Public License|GPL]]<nowiki />v3 | ||
|- | |- | ||
− | |<translate>Redirect</translate> | + | |<translate><!--T:15--> |
+ | Redirect</translate> | ||
|<pre>#REDIRECT [[Main Page]]</pre> | |<pre>#REDIRECT [[Main Page]]</pre> | ||
− | <translate>See also [[Help:Redirects]]</translate> | + | <translate><!--T:16--> |
+ | See also [[<tvar|redirects>Special:MyLanguage/Help:Redirects</>|Help:Redirects]]</translate> | ||
| → [[Main Page]] | | → [[Main Page]] | ||
|- | |- | ||
− | |<translate>Internal link to an anchor</translate> | + | |<translate><!--T:17--> |
+ | Internal link to an anchor</translate> | ||
|<pre>[[#See also]]</pre> | |<pre>[[#See also]]</pre> | ||
− | [[Help:Formatting|Section headings]] and the [[#top|top]] of the page are automatically anchored. | + | <translate><!--T:77--> |
+ | [[<tvar|formatting>Special:MyLanguage/Help:Formatting</>|Section headings]] and the [[#top|top]] of the page are automatically anchored.</translate> | ||
|[[#See also]] | |[[#See also]] | ||
|- | |- | ||
− | |<translate>Internal link to an anchor from different text</translate> | + | |<translate><!--T:18--> |
+ | Internal link to an anchor from different text</translate> | ||
|<pre>[[#See also|different text]]</pre> | |<pre>[[#See also|different text]]</pre> | ||
|[[#See also|different text]] | |[[#See also|different text]] | ||
|- | |- | ||
− | |<translate>Setting an internal link anchor</translate> | + | |<translate><!--T:19--> |
+ | Setting an internal link anchor</translate> | ||
|<pre><div id="NameOfAnchorHere">optional text</div></pre> | |<pre><div id="NameOfAnchorHere">optional text</div></pre> | ||
Omit the "optional text" for invisible anchor. | Omit the "optional text" for invisible anchor. | ||
|<div id="NameOfAnchorHere">optional text</div> | |<div id="NameOfAnchorHere">optional text</div> | ||
|- | |- | ||
− | |<translate>Internal link to an anchor at another page</translate> | + | |<translate><!--T:20--> |
+ | Internal link to an anchor at another page</translate> | ||
|<pre>[[Help:Images#Supported media types for images]]</pre> | |<pre>[[Help:Images#Supported media types for images]]</pre> | ||
|[[Help:Images#Supported media types for images]] | |[[Help:Images#Supported media types for images]] | ||
|- | |- | ||
− | |<translate>Internal link to the current page's talk page</translate> | + | |<translate><!--T:21--> |
+ | Internal link to the current page's talk page</translate> | ||
|<pre>[[{{TALKPAGENAME}}|Discussion]]</pre> | |<pre>[[{{TALKPAGENAME}}|Discussion]]</pre> | ||
− | <translate>See also [[Help:Magic_words#Page_names]]</translate> | + | <translate><!--T:22--> |
+ | See also [[<tvar|page-names>Special:MyLanguage/Help:Magic_words#Page_names</>|Help:Magic_words#Page_names]]</translate> | ||
|[[{{TALKPAGENAME}}|Discussion]] | |[[{{TALKPAGENAME}}|Discussion]] | ||
|- | |- | ||
− | |<translate>Internal link to a subpage</translate> | + | |<translate><!--T:23--> |
+ | Internal link to a subpage</translate> | ||
|<pre>[[/example]]</pre> | |<pre>[[/example]]</pre> | ||
− | Shortcut for <code><nowiki>[[Help:Links/example|/example]]</nowiki></code>. See also [[Help:Subpages]]. | + | <translate><!--T:78--> |
+ | Shortcut for <code><nowiki>[[Help:Links/example|/example]]</nowiki></code>. See also [[<tvar|subpages>Special:MyLanguage/Help:Subpages</>|Help:Subpages]].</translate> | ||
|[[Help:Links/example|/example]] | |[[Help:Links/example|/example]] | ||
|- | |- | ||
− | |<translate>Internal link to a subpage without the leading slash</translate> | + | |<translate><!--T:24--> |
+ | Internal link to a subpage without the leading slash</translate> | ||
|<pre>[[/example/]]</pre> | |<pre>[[/example/]]</pre> | ||
Shortcut for <code><nowiki>[[Help:Links/example|example]]</nowiki></code>. | Shortcut for <code><nowiki>[[Help:Links/example|example]]</nowiki></code>. | ||
|[[Help:Links/example|example]] | |[[Help:Links/example|example]] | ||
|- | |- | ||
− | |<translate>Internal link to a category page</translate> | + | |<translate><!--T:25--> |
+ | Internal link to a category page</translate> | ||
|<pre>[[:Category:Help]]</pre> | |<pre>[[:Category:Help]]</pre> | ||
− | <translate>See also [[Help:Categories]]</translate> | + | <translate><!--T:26--> |
+ | See also [[<tvar|cat>Special:MyLanguage/Help:Categories</>|Help:Categories]]</translate> | ||
|[[:Category:Help]] | |[[:Category:Help]] | ||
|- | |- | ||
− | |<translate>Internal link to an image or a file of other types</translate> | + | |<translate><!--T:27--> |
+ | Internal link to an image or a file of other types</translate> | ||
|<pre>[[media:example.jpg]] | |<pre>[[media:example.jpg]] | ||
[[media:example.pdf]]</pre> | [[media:example.pdf]]</pre> | ||
− | <translate>See also [[Help:Images]]</translate> | + | Linking directly to a file page without creating a thumbnail is done by the following syntax: |
+ | <nowiki>[[:File:example.pdf]]</nowiki> | ||
+ | <translate><!--T:28--> | ||
+ | See also [[<tvar|images>Special:MyLanguage/Help:Images</>|Help:Images]]</translate> | ||
|[[media:example.jpg]] | |[[media:example.jpg]] | ||
[[media:example.pdf]] | [[media:example.pdf]] | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | [[:File:example.pdf]] | ||
|- | |- | ||
− | |<translate>Internal link to the user's user page</translate> | + | |<translate><!--T:29--> |
+ | Internal link to the user's user page</translate> | ||
|<pre>[[Special:MyPage]]</pre> | |<pre>[[Special:MyPage]]</pre> | ||
|[[Special:MyPage]] | |[[Special:MyPage]] | ||
|- | |- | ||
− | |<translate>Internal link to the user's talk page</translate> | + | |<translate><!--T:30--> |
+ | Internal link to the user's talk page</translate> | ||
|<pre>[[Special:MyTalk]]</pre> | |<pre>[[Special:MyTalk]]</pre> | ||
|[[Special:MyTalk]] | |[[Special:MyTalk]] | ||
|} | |} | ||
+ | |||
+ | {{Anchor|External|External links}} | ||
<translate> | <translate> | ||
− | |||
+ | == External links == <!--T:31--> | ||
+ | |||
+ | <!--T:32--> | ||
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. | 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. | ||
</translate> | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
− | !style="width:15%"|<translate>Description</translate> | + | !style="width:15%"|<translate><!--T:33--> |
− | !style="width:45%"|<translate>You type</translate> | + | Description</translate> |
− | !style="width:40%"|<translate>You get</translate> | + | !style="width:45%"|<translate><!--T:34--> |
+ | You type</translate> | ||
+ | !style="width:40%"|<translate><!--T:35--> | ||
+ | You get</translate> | ||
|- | |- | ||
− | |<translate>External link</translate> | + | |<translate><!--T:36--> |
− | |<tt><nowiki> | + | External link</translate> |
− | | | + | |<tt><nowiki>https://mediawiki.org</nowiki></tt> |
+ | |https://mediawiki.org | ||
|- | |- | ||
− | |<translate>External link with different label</translate> | + | |<translate><!--T:37--> |
− | |<tt><nowiki>[ | + | External link with different label</translate> |
− | |[ | + | |<tt><nowiki>[https://mediawiki.org MediaWiki]</nowiki></tt> |
+ | |[https://mediawiki.org MediaWiki] | ||
|- | |- | ||
− | |<translate>Numbered external link</translate> | + | |<translate><!--T:38--> |
− | |<tt><nowiki>[ | + | Numbered external link</translate> |
− | |[ | + | |<tt><nowiki>[https://mediawiki.org]</nowiki></tt> |
+ | |[https://mediawiki.org] | ||
+ | |- | ||
+ | |<translate><!--T:39--> | ||
+ | External links with file icons</translate> | ||
+ | |<tt> | ||
+ | <nowiki>[https://en.wikipedia.org/wiki/.avi video]</nowiki> | ||
+ | <nowiki>[https://en.wikipedia.org/wiki/.ogg sound]</nowiki> | ||
+ | <nowiki>[https://en.wikipedia.org/wiki/.pdf document]</nowiki> | ||
+ | </tt> | ||
+ | <small><translate><!--T:40--> | ||
+ | See [[<tvar|external3>#External link icons</>]] for currently supported icons and extensions.</translate></small> | ||
+ | | | ||
+ | [[:en:.avi|video]]<br/> | ||
+ | [[:en:.ogg|sound]]<br/> | ||
+ | [[:en:.pdf|document]]<br/> | ||
|- | |- | ||
− | |<translate> | + | |<translate> |
− | |<tt><nowiki> | + | <!--T:75--> |
− | [ | + | Protocol-relative external link (Will be http if the current URL uses http, or https if it uses https)</translate> |
− | [ | + | |<tt> |
− | + | <nowiki>[//en.wikipedia.org Wikipedia]</nowiki><br/><nowiki> | |
+ | [//en.wikipedia.org //en.wikipedia.org] | ||
</nowiki></tt> | </nowiki></tt> | ||
− | <small><translate> | + | <small><translate><!--T:76--> |
+ | This is only supported inside square brackets <tt><nowiki>[ ]</nowiki></tt> – //en.wikipedia.org by itself does not make a link.</translate></small> | ||
| | | | ||
− | [ | + | [//en.wikipedia.org Wikipedia]<br/> |
− | [ | + | [//en.wikipedia.org //en.wikipedia.org] |
− | |||
|- | |- | ||
− | |<translate>External link to the same host</translate> | + | |<translate><!--T:41--> |
− | |<tt><nowiki> | + | External link to the same host</translate> |
− | | | + | |<tt><nowiki>https://{{SERVERNAME}}/pagename</nowiki></tt> |
+ | |https://www.mediawiki.org/pagename | ||
|- | |- | ||
− | |<translate>External link to other host passing the pagename</translate> | + | |<translate><!--T:42--> |
− | |<tt><nowiki> | + | External link to other host passing the pagename</translate> |
− | See also: [[Help:Magic_words#URL_encoded_page_names | URL encoded page names]], [[Manual:PAGENAMEE encoding|PAGENAMEE encoding]] | + | |<tt><nowiki>https://google.com/search?q={{PAGENAMEE}}</nowiki></tt><br /> |
− | | | + | <translate><!--T:79--> |
+ | See also: [[<tvar|encoded>Special:MyLanguage/Help:Magic_words#URL_encoded_page_names</>|URL encoded page names]], [[<tvar|PAGENAMEE>Special:MyLanguage/Manual:PAGENAMEE encoding</>|PAGENAMEE encoding]]</translate> | ||
+ | |https://google.com/search?q=Links | ||
|- | |- | ||
− | |<translate>Mailto link</translate> | + | |<translate><!--T:43--> |
+ | Mailto link</translate> | ||
|<tt><nowiki>[mailto:info@example.org email me]</nowiki></tt> | |<tt><nowiki>[mailto:info@example.org email me]</nowiki></tt> | ||
|[mailto:info@example.org email me] | |[mailto:info@example.org email me] | ||
|- | |- | ||
− | |<translate>Mailto named with subject line and body</translate> | + | |<translate><!--T:44--> |
+ | Mailto named with subject line and body</translate> | ||
|<tt><nowiki>[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info]</nowiki></tt> | |<tt><nowiki>[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info]</nowiki></tt> | ||
|[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info] | |[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info] | ||
+ | |- | ||
+ | |<translate><!--T:80--> | ||
+ | Custom URI</translate> | ||
+ | ||<tt><nowiki>[skype:echo123 call me]</nowiki></tt> | ||
+ | <small><translate><!--T:81--> | ||
+ | Any URI you wish to add needs to be first declared through <tvar|UrlProtocols>{{ll|Manual:$wgUrlProtocols|$wgUrlProtocols}}</>.</translate></small> | ||
+ | |[skype:echo123 call me]<br /><translate><!--T:82--> | ||
+ | (Disabled on mediawiki.org)</translate> | ||
|} | |} | ||
+ | {{Anchor|External-to-internal|External links to internal pages}} | ||
<translate> | <translate> | ||
− | === External links to internal pages === | + | === External links to internal pages === <!--T:45--> |
+ | <!--T:46--> | ||
To add a link to a page on the same wiki using [[w:URI scheme | URL query parameters]], you may need to use external link syntax. | To add a link to a page on the same wiki using [[w:URI scheme | URL query parameters]], you may need to use external link syntax. | ||
</translate> | </translate> | ||
{| border="1" class="wikitable" | {| border="1" class="wikitable" | ||
− | !<translate>Description</translate> | + | !<translate><!--T:47--> |
− | !<translate>You type</translate> | + | Description</translate> |
− | !<translate>You get</translate> | + | !<translate><!--T:48--> |
+ | You type</translate> | ||
+ | !<translate><!--T:49--> | ||
+ | You get</translate> | ||
|- | |- | ||
− | |<translate>External link to the current page's edit page</translate> | + | |<translate><!--T:50--> |
− | |< | + | External link to the current page's edit page</translate> |
− | |[ | + | |<div class="mw-code"><nowiki>[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</nowiki></div> |
+ | |[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page] | ||
|- | |- | ||
− | |<translate>External link to the current page's edit page using the [[Help:Magic_words#URL_data | fullurl parser function]]</translate> | + | |<translate><!--T:51--> |
− | |< | + | External link to the current page's edit page using the [[<tvar|url-data>Special:MyLanguage/Help:Magic_words#URL_data</>|fullurl parser function]]</translate> |
− | <translate>See also [[Help:Magic_words#URL_data]] and [[#External links]]</translate> | + | |<div class="mw-code"><nowiki>[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]</nowiki></div> |
+ | <translate><!--T:52--> | ||
+ | See also [[<tvar|url-data>Special:MyLanguage/Help:Magic_words#URL_data</>|Help:Magic_words#URL_data]] and [[<tvar|external>#External links</>|#External links]]</translate> | ||
|[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page] | |[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page] | ||
|- | |- | ||
− | |<translate>External link to the current page's edit page, and styled to look like an internal link</translate> | + | |<translate><!--T:53--> |
− | |< | + | External link to the current page's edit page, and styled to look like an internal link</translate> |
− | <translate>The [[Plainlinks | plainlinks class]] 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.</translate> | + | |<div class="mw-code"><nowiki><span class="plainlinks">[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</nowiki><nowiki></span></nowiki></div> |
− | |<span class="plainlinks">[ | + | <translate><!--T:54--> |
+ | The [[Plainlinks | plainlinks class]] 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.</translate> | ||
+ | |<span class="plainlinks">[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</span> | ||
|} | |} | ||
− | <translate>=== External link icons ===</translate> | + | {{anchor|External link icons}} |
+ | <translate> | ||
+ | === External link icons === <!--T:55--> | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! <translate>Test link</translate> !! <translate>Icon</translate> !! <translate>Trigger</translate> | + | ! <translate><!--T:56--> |
+ | Test link</translate> !! <translate><!--T:57--> | ||
+ | Icon</translate> !! <translate><!--T:58--> | ||
+ | Trigger</translate> | ||
|- | |- | ||
− | | [http://.] || [ | + | | [http://.] || [[File:Icon External Link.png]] || <code>http://</code>, <code>gopher://</code>, <code>[//]</code> |
|- | |- | ||
− | | [https://.] || [ | + | | [https://.] || [[File:Lock icon blue.gif]] || <code>https://</code> |
|- | |- | ||
− | | [mailto:.] || [ | + | | [mailto:.] || [[File:Icon External Link E-Mail.png]] || <code>mailto:</code> |
|- | |- | ||
− | | [news://.] || [ | + | | [news://.] || [[File:Icon External Link Newsgroups.png]] || <code>news<nowiki/>://</code> |
|- | |- | ||
− | | [ftp://.] || [ | + | | [ftp://.] || [[File:Icon External Link FTP.png]] || <code>ftp://</code> |
|- | |- | ||
− | | [irc://.] || [ | + | | [irc://.] || [[File:Icon External Link IRC.png]] || <code>irc://</code> |
|- | |- | ||
− | | [http://.ogg] || [ | + | | [http://.ogg] || [[File:Icon External Link MP3.png]] || <code>.ogg</code>, <code>.mid</code>, <code>.midi</code>, <code>.mp3</code>, <code>.wav</code>, <code>.wma</code> |
|- | |- | ||
− | | [http://.ogm] || [ | + | | [http://.ogm] || [[File:Icon External Link Video.png]] || <code>.ogm</code>, <code>.avi</code>, <code>.mpeg</code>, <code>.mpg</code> |
|- | |- | ||
− | | [http://.pdf] || [ | + | | [http://.pdf] || [[File:Icons-mini-file acrobat.gif]] || <code>.pdf</code>, <code>.pdf#</code>, <code>.pdf?</code> |
|} | |} | ||
<translate> | <translate> | ||
− | === How to avoid auto-links === | + | === How to avoid auto-links === <!--T:59--> |
− | When you put a URL on a wiki page it will be automatically converted into an external link, like this: | + | <!--T:60--> |
+ | When you put a URL on a wiki page, it will be automatically converted into an external link, like this: | ||
</translate> | </translate> | ||
− | + | https://mediawiki.org | |
<translate> | <translate> | ||
+ | <!--T:61--> | ||
To avoid that effect, put the URL between <tvar|1><code><nowiki></code></> tags, like this: | To avoid that effect, put the URL between <tvar|1><code><nowiki></code></> tags, like this: | ||
</translate> | </translate> | ||
− | <pre><nowiki> | + | <pre><nowiki>https://mediawiki.org</nowiki></pre> |
− | <translate>To get this:</translate> | + | <translate><!--T:62--> |
+ | To get this:</translate> | ||
− | <nowiki> | + | <nowiki>https://mediawiki.org</nowiki> |
+ | {{Anchor|Interwiki|Interwiki links}} | ||
<translate> | <translate> | ||
+ | == Interwiki links == <!--T:63--> | ||
− | + | <!--T:64--> | |
+ | Interwiki links are links with the internal link markup to a website registered in advance. For example, you can link to the article http://en.wikipedia.org/wiki/Sunflower by typing <code><nowiki>[[wikipedia:Sunflower]]</nowiki></code>, which will result in a link [[wikipedia:Sunflower]]. This works because by default MediaWiki configures <code>wikipedia:</code> as an "interwiki prefix" that turns into <nowiki>http://en.wikipedia.org/wiki/</nowiki> when used inside <nowiki>[[ ]]</nowiki>. (''It may not work if the admin of your wiki has changed the setting.'') Unlike internal links, interwiki links do not use page existence detection, so an interwiki link will appear blue even if the page does not exist on the remote wiki. | ||
− | + | <!--T:65--> | |
+ | Similar to internal page links, you can create piped links, with alternate link label, e.g. <code><nowiki>[[wikipedia:Sunflower|big yellow flower]]</nowiki></code> is the link [[wikipedia:Sunflower|big yellow flower]] and <code><nowiki>[[wikipedia:Sunflower|]]</nowiki></code> is the link [[wikipedia:Sunflower|Sunflower]]. | ||
− | + | <!--T:66--> | |
+ | Basically, interwiki links are abbreviations for commonly-used longer external links. A very similar link could be created as <code><nowiki>[http://en.wikipedia.org/wiki/Sunflower big yellow flower]</nowiki></code>. | ||
− | + | <!--T:67--> | |
+ | More details are at [[<tvar|interwiki>Special:MyLanguage/Manual:Interwiki</>|Manual:Interwiki]] and [[m:Help:Interwiki linking]]. Your wiki may have a [[Special:Interwiki]] page listing the interwiki prefixes it supports; {{git file | file=maintenance/interwiki.list | text=here is the default interwiki list}}. You can edit the [[<tvar|interwiki-table>Special:MyLanguage/Manual:Interwiki table</>|Manual:Interwiki table]] on your site. | ||
+ | </translate> | ||
− | + | {{anchor|Interlanguage links}} | |
+ | <translate> | ||
+ | === Interlanguage links === <!--T:68--> | ||
− | + | <!--T:69--> | |
− | + | If your wiki has other language versions, you may find “interlanguage links” in the [[<tvar|sidebar>Special:MyLanguage/Help:Navigation#Sidebar</>|sidebar]], just below [[<tvar|toolbox>Special:MyLanguage/Help:Navigation#Toolbox</>|toolbox]] in the box named “{{lcfirst:{{int:otherlanguages}}}}.” | |
− | If your wiki has other language versions, you may find “interlanguage links” in the [[Help:Navigation#Sidebar|sidebar]], just below [[Help:Navigation#Toolbox|toolbox]] in the box named “{{lcfirst:{{int:otherlanguages}}}}.” | ||
+ | <!--T:70--> | ||
Interlanguage links behave similarly to interwiki links, except that they are listed in the sidebar. To create an interlanguage link from a page, just type <code><nowiki>[[</nowiki>''language prefix'':pagename]]</code> wherever you like in the page; the language prefix is the prefix specified at your wiki for the other language version (typically the [[wikipedia:List of ISO 639-1 codes|ISO 639-1 language code]]). | Interlanguage links behave similarly to interwiki links, except that they are listed in the sidebar. To create an interlanguage link from a page, just type <code><nowiki>[[</nowiki>''language prefix'':pagename]]</code> wherever you like in the page; the language prefix is the prefix specified at your wiki for the other language version (typically the [[wikipedia:List of ISO 639-1 codes|ISO 639-1 language code]]). | ||
− | If you want to make the interlanguage link appear in the content of the page, you can add a colon before the language prefix: | + | <!--T:71--> |
+ | If you want to make the interlanguage link appear in the content of the page rather than in the sidebar, you can add a colon before the language prefix: | ||
:<code><nowiki>[[:en:Sunflower]]</nowiki></code> → '''[[:en:Sunflower]]''' | :<code><nowiki>[[:en:Sunflower]]</nowiki></code> → '''[[:en:Sunflower]]''' | ||
− | When link is both interwiki and interlanguage, the order is '''[[wikipedia:en:Sunflower]]'''. | + | <!--T:72--> |
+ | <!-- This isn't working for me here nor on Commons today (I get https://en.wikipedia.org/wiki/en:Sunflower): When a link is both interwiki and interlanguage, the order is '''[[wikipedia:en:Sunflower]]'''. --> | ||
+ | </translate> | ||
− | + | {{anchor|See also}} | |
+ | <translate> | ||
− | + | == See also == <!--T:73--> | |
− | |||
+ | <!--T:74--> | ||
+ | * [[<tvar|linked-images>Special:MyLanguage/Help:Linked images</>|Linked images]] | ||
</translate> | </translate> | ||
− | |||
− | [[Category:Help|Links]] | + | [[Category:Help{{translation}}|Links]] |
− | [[Category:Link|Links]] | + | [[Category:Link{{translation}}|Links]] |
2016年7月24日 (日) 00:25時点における最新版
Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info.
|
There are five types of links in MediaWiki:
- Internal links to other pages in the wiki
- External links to other websites
- External links to internal pages in the wiki
- Interwiki links to other websites registered to the wiki in advance
- Interlanguage links to other websites registered as other language versions of 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]] [[Help:Contents]] [[Extension:DynamicPageList (Wikimedia)]] |
Main Page |
Piped link | [[Main Page|different text]] [[Main Page#Concrete_Paragraph|different text2]] See also meta:Help:Piped link |
different text |
Pipe trick | [[Help:Contents|]] [[User:John Doe|]] [[Extension:DynamicPageList (Wikimedia)|]] [[Extension:DynamicPageList (third-party)|]] The pipe trick quickly makes shorter link text, but could be confusing in circumstances like the DynamicPageList link examples. |
Contents |
Word-ending links, following so called "linktrail rules" localised per each language | [[Help]]s [[Help]]ing [[Help]]ers [[Help]]almostanylettersyoulikehere |
|
Avoiding word-ending links | [[Help]]<nowiki />ful advice [[wikipedia:GNU General Public License|GPL]]<nowiki />v3 |
Helpful advice GPLv3 |
Redirect | #REDIRECT [[Main Page]] See also Help:Redirects |
→ Main Page |
Internal link to an anchor | [[#See also]] Section headings and the top of the page are automatically anchored. |
#See also |
Internal link to an anchor from different text | [[#See also|different text]] |
different text |
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:Images#Supported media types for images]] |
Help:Images#Supported media types for images |
Internal link to the current page's talk page | [[{{TALKPAGENAME}}|Discussion]] See also Help:Magic_words#Page_names |
Discussion |
Internal link to a subpage | [[/example]] Shortcut for |
/example |
Internal link to a subpage without the leading slash | [[/example/]] Shortcut for |
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]] [[media:example.pdf]] 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 |
Internal link to the user's user page | [[Special:MyPage]] |
Special:MyPage |
Internal link to the user's talk page | [[Special:MyTalk]] |
Special:MyTalk |
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://mediawiki.org | https://mediawiki.org |
External link with different label | [https://mediawiki.org MediaWiki] | MediaWiki |
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] See #External link icons for currently supported icons and extensions. |
|
Protocol-relative external link (Will be http if the current URL uses http, or https if it uses https) |
[//en.wikipedia.org Wikipedia] |
|
External link to the same host | https://{{SERVERNAME}}/pagename | https://www.mediawiki.org/pagename |
External link to other host passing the pagename | https://google.com/search?q={{PAGENAMEE}} See also: URL encoded page names, PAGENAMEE encoding |
https://google.com/search?q=Links |
Mailto link | [mailto:info@example.org email me] | email me |
Mailto named with subject line and body | [mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info] | info |
Custom URI | [skype:echo123 call me]
Any URI you wish to add needs to be first declared through $wgUrlProtocols. |
[skype:echo123 call me] (Disabled on mediawiki.org) |
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 using the fullurl parser function | [{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]
See also Help:Magic_words#URL_data and #External links |
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>
The plainlinks class 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 |
External link icons[編集]
Test link | Icon | Trigger |
---|---|---|
[2] | ファイル:Icon External Link.png | http:// , gopher:// , [//]
|
[3] | ファイル:Lock icon blue.gif | https://
|
[4] | ファイル:Icon External Link E-Mail.png | mailto:
|
[5] | ファイル:Icon External Link Newsgroups.png | news://
|
[6] | ファイル:Icon External Link FTP.png | ftp://
|
[7] | ファイル:Icon External Link IRC.png | irc://
|
[8] | ファイル:Icon External Link MP3.png | .ogg , .mid , .midi , .mp3 , .wav , .wma
|
[9] | ファイル:Icon External Link Video.png | .ogm , .avi , .mpeg , .mpg
|
[10] | ファイル:Icons-mini-file acrobat.gif | .pdf , .pdf# , .pdf?
|
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:
To avoid that effect, put the URL between <nowiki>
tags, like this:
<nowiki>https://mediawiki.org</nowiki>
To get this:
https://mediawiki.org
Interwiki links[編集]
Interwiki links are links with the internal link markup to a website registered in advance. For example, you can link to the article http://en.wikipedia.org/wiki/Sunflower by typing [[wikipedia:Sunflower]]
, which will result in a link wikipedia:Sunflower. This works because by default MediaWiki configures wikipedia:
as an "interwiki prefix" that turns into http://en.wikipedia.org/wiki/ when used inside [[ ]]. (It may not work if the admin of your wiki has changed the setting.) Unlike internal links, interwiki links do not use page existence detection, so an interwiki link will appear blue even if the page does not exist on the remote wiki.
Similar to internal page links, you can create piped links, with alternate link label, e.g. [[wikipedia:Sunflower|big yellow flower]]
is the link big yellow flower and [[wikipedia:Sunflower|]]
is the link Sunflower.
Basically, interwiki links are abbreviations for commonly-used longer external links. A very similar link could be created as [http://en.wikipedia.org/wiki/Sunflower big yellow flower]
.
More details are at Manual:Interwiki and m:Help:Interwiki linking. Your wiki may have a Special:Interwiki page listing the interwiki prefixes it supports; here is the default interwiki list. You can edit the Manual:Interwiki table on your site.
Interlanguage links[編集]
If your wiki has other language versions, you may find “interlanguage links” in the sidebar, just below toolbox in the box named “他言語版.”
Interlanguage links behave similarly to interwiki links, except that they are listed in the sidebar. To create an interlanguage link from a page, just type [[language prefix:pagename]]
wherever you like in the page; the language prefix is the prefix specified at your wiki for the other language version (typically the ISO 639-1 language code).
If you want to make the interlanguage link appear in the content of the page rather than in the sidebar, you can add a colon before the language prefix:
[[:en:Sunflower]]
→ en:Sunflower