Link Reference in the Wiki: Difference between revisions

From RCGRS MRT Wiki
Jump to navigation Jump to search
(Created page with "One of the confusing things about creating links to pages is that the syntax of the link reference is dependent on the "domain" of the page, which may be this instance of MediaWiki, or some other instance like Wikipedia, or MediaWiki itself (which really is its own instance of the MediaWiki application). In some instances, the full URL is needed, in others, the substitution of <code>"mediawikiwiki:"</code> for <code><nowiki>"https://MediaWiki.org/"</nowiki></code> works,...")
 
No edit summary
Line 1: Line 1:
One of the confusing things about creating links to pages is that the syntax of the link reference is dependent on the "domain" of the page, which may be this instance of MediaWiki, or some other instance like Wikipedia, or MediaWiki itself (which really is its own instance of the MediaWiki application). In some instances, the full URL is needed, in others, the substitution of <code>"mediawikiwiki:"</code> for <code><nowiki>"https://MediaWiki.org/"</nowiki></code> works, and others do not require either the full URL or the substitution. For example: the "Special" page that lists all the pages in this instance of MediaWiki (i.e., the RCGRS.com version) has the full URL of<br>
[[Category:Works In Progress]]
<code><nowiki>https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages</nowiki></code> ⟹ https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages<br>
<span style="color:red;">This is a new article being developed by Don Erikstrup ([[User:DErik|DErik]] ([[User talk:DErik|talk]]) 18:20, 2 May 2023 (PDT))</span>
and it can be included in any page just that way. It can also be referenced with single or double brackets around it like so:<br>
One of the confusing things about creating links to pages is that the syntax of the link reference is dependent on the "domain" of the page, which may be this instance of MediaWiki, or some other instance like Wikipedia, or MediaWiki itself (which really is its own instance of the MediaWiki application). In some instances, the full URL is needed, in others, the substitution of <code>"mediawikiwiki:"</code> for <code><nowiki>"https://MediaWiki.org/"</nowiki></code> works, and others do not require either the full URL or the substitution. For example: the "Special" page that lists all the pages in this instance of MediaWiki (i.e., the RCGRS.com version) has the full URL of
<code><nowiki>[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]</nowiki></code> ⟹ [https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]<br>
 
<code><nowiki>[[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]]</nowiki></code> ⟹ [[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]]<br>
<code><nowiki>https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages</nowiki></code> ⟹ https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages
But note that using double brackets kind of ignores the second set, taking it as additional text around the reference.<br>Also, those last two examples could include text that replaces the reference text. This is called "link text" in some of the help files). Here are examples with "link text":<br>
 
<code><nowiki>[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]</nowiki></code> ⟹ [https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]<br>
and it can be included in any page just that way. It can also be referenced with single or double brackets around it like so:
<code><nowiki>[[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages|List all pages]]</nowiki></code> ⟹ [[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]]<br>
 
Now, because these are full URLs (they include the communications protocol specification of <code>https://</code>) they are treated as '''''external''''' links. But the "Special" pages are typically '''''internal''''' pages. That is, they are specific to this instance of the MediaWiki installation. Note that the URL has <code>www.rcgrs.com/mrtwiki/index.php?title=</code> as part of the it. The part that specifies this is the <code>rcgrs.com</code> domain is how we know it is really specific to this MediaWiki installation instance; other instances have different domains. So, since it is '''''internal''''', it can be referenced with just the page title, with or without additional text, wrapped in double square brackets, like so:<br>
<code><nowiki>[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]</nowiki></code> ⟹ [https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]
<code><nowiki>[[Special:AllPages]]</nowiki></code> ⟹ [[Special:AllPages]]<br>
 
<code><nowiki>[[Special:AllPages|List all pages]]</nowiki></code> ⟹ [[Special:AllPages|List all pages]]<br>
<code><nowiki>[[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]]</nowiki></code> ⟹ [[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]]
But trying to reference an '''''internal''''' page with just one set of square brackets, here's what happens:<br>
 
<code><nowiki>[Special:AllPages]</nowiki></code> ⟹ [Special:AllPages]<br>
But note that using double brackets kind of ignores the second set, taking it as additional text around the reference.<br>Also, those last two examples could include text that replaces the reference text. This is called "link text" in some of the help files). Here are examples with "link text":
<code><nowiki>[Special:AllPages|List all pages]</nowiki></code> ⟹ [Special:AllPages|List all pages]<br>
 
Well that didn't work at all. It doesn't even recognize it as a link.<br>
<code><nowiki>[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]</nowiki></code> ⟹ [https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]
Let's try doing the last form to reference the MediaWiki main help file, which is '''''external''''':<br>
 
<code><nowiki>[Help:Contents|Attempt to display MediaWiki help]</nowiki></code> ⟹ [Help:Contents|Attempt to display MediaWiki help]<br>
<code><nowiki>[[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages|List all pages]]</nowiki></code> ⟹ [[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]]
It again doesn't even recognize it as a link. So wrap it in another set of square brackets, since it is an '''''external''''' page:<br>
 
<code><nowiki>[[Help:Contents|Attempt to display MediaWiki help]]</nowiki></code> ⟹ [[Help:Contents|Attempt to display MediaWiki help]]<br>
Now, because these are full URLs (they include the communications protocol specification of <code>https://</code>) they are treated as '''''external''''' links. But the "Special" pages are typically '''''internal''''' pages. That is, they are specific to this instance of the MediaWiki installation. Note that the URL has <code>www.rcgrs.com/mrtwiki/index.php?title=</code> as part of the it. The part that specifies this is the <code>rcgrs.com</code> domain is how we know it is really specific to this MediaWiki installation instance; other instances have different domains. So, since it is '''''internal''''', it can be referenced with just the page title, with or without additional text, wrapped in double square brackets, like so:
It at least recognized it as a link, but note that the reference is in red letters. This indicates the page could not be found by MediaWiki. Why? Because it needs the protocol (at least a double slash ("//"), I think they assume the "http:" or "https:" if just the "//" is present - I recall reading that somewhere) and domain specified. Let's try it again with that added:<br>
 
<code><nowiki>[https://www.MediaWiki.org/Help:Contents|Attempt to display MediaWiki help]</nowiki></code> ⟹ [https://www.MediaWiki.org/Help:Contents Attempt to display MediaWiki help]<br>
<code><nowiki>[[Special:AllPages]]</nowiki></code> ⟹ [[Special:AllPages]]
Well, that recognized it as a link reference, but the link doesn't work (not found error). Why? Because MediaWiki actually puts this stuff in a directory called '''wiki'''. So we need to include that in the link text:<br>
 
<code><nowiki>[https://www.MediaWiki.org/wiki/Help:Contents|Attempt to display MediaWiki help]</nowiki></code> ⟹ [https://www.MediaWiki.org/wiki/Help:Contents Attempt to display MediaWiki help]<br>
<code><nowiki>[[Special:AllPages|List all pages]]</nowiki></code> ⟹ [[Special:AllPages|List all pages]]
How did I know it was in that '''wiki''' directory? I had looked up help via some other link and took note of the actual URL. Also, when I got the "404 Not found" error, the page asked if I really meant '''wiki/Help:Contents'''. That was nice of them.<br>
 
Now recall my mention of "mediawikiwiki:"? Let's try substituting that for the protocol and MediaWiki domain specification in a reference to their help file. First the full reference as it would normally be done:<br>
But trying to reference an '''''internal''''' page with just one set of square brackets, here's what happens:
<code><nowiki>[http://www.MediaWiki.org/wiki/Help:Contents Attempt to display MediaWiki help]</nowiki></code> ⟹ [http://www.MediaWiki.org/wiki/Help:Contents Attempt to display MediaWiki help]<br>
 
Now the revised reference:<br>
<code><nowiki>[Special:AllPages]</nowiki></code> ⟹ [Special:AllPages]
<code><nowiki>[[MediaWikiwiki:Help:Contents|Attempt to display MediaWiki help]]</nowiki></code> ⟹ [[MediaWikiwiki:Help:Contents|Attempt to display MediaWiki help]]<br>
 
Note that reference is now wrapped in double square brackets and the "link text" is delimited with a pipe ("|") rather than a space. This is because it is now considered and '''''internal''''' reference, and must therefore follow that syntax.<br>
<code><nowiki>[Special:AllPages|List all pages]</nowiki></code> ⟹ [Special:AllPages|List all pages]
 
Well that didn't work at all. It doesn't even recognize it as a link.
 
Let's try doing the last form to reference the MediaWiki main help file, which is '''''external''''':
 
<code><nowiki>[Help:Contents|Attempt to display MediaWiki help]</nowiki></code> ⟹ [Help:Contents|Attempt to display MediaWiki help]
 
It again doesn't even recognize it as a link. So wrap it in another set of square brackets, since it is an '''''external''''' page:
 
<code><nowiki>[[Help:Contents|Attempt to display MediaWiki help]]</nowiki></code> ⟹ [[Help:Contents|Attempt to display MediaWiki help]]
 
It at least recognized it as a link, but note that the reference is in red letters. This indicates the page could not be found by MediaWiki. Why? Because it needs the protocol (at least a double slash ("//"), I think they assume the "http:" or "https:" if just the "//" is present - I recall reading that somewhere) and domain specified. Let's try it again with that added:
 
<code><nowiki>[https://www.MediaWiki.org/Help:Contents|Attempt to display MediaWiki help]</nowiki></code> ⟹ [https://www.MediaWiki.org/Help:Contents Attempt to display MediaWiki help]
 
Well, that recognized it as a link reference, but the link doesn't work (not found error). Why? Because MediaWiki actually puts this stuff in a directory called '''wiki'''. So we need to include that in the link text:
 
<code><nowiki>[https://www.MediaWiki.org/wiki/Help:Contents|Attempt to display MediaWiki help]</nowiki></code> ⟹ [[mediawikiwiki:Help:Contents|Attempt to display MediaWiki help]]
 
How did I know it was in that '''wiki''' directory? I had looked up help via some other link and took note of the actual URL. Also, when I got the "404 Not found" error, the page asked if I really meant '''wiki/Help:Contents'''. That was nice of them.
 
Now recall my mention of "mediawikiwiki:"? Let's try substituting that for the protocol and MediaWiki domain specification in a reference to their help file. First the full reference as it would normally be done:
 
<code><nowiki>[http://www.MediaWiki.org/wiki/Help:Contents Attempt to display MediaWiki help]</nowiki></code> ⟹ [http://www.MediaWiki.org/wiki/Help:Contents Attempt to display MediaWiki help]
 
Now the revised reference:
 
<code><nowiki>[[MediaWikiwiki:Help:Contents|Attempt to display MediaWiki help]]</nowiki></code> ⟹ [[MediaWikiwiki:Help:Contents|Attempt to display MediaWiki help]]
 
Note that reference is now wrapped in double square brackets and the "link text" is delimited with a pipe ("|") rather than a space. This is because it is now considered an '''''internal''''' reference, and must therefore follow that syntax.
 
I hope that helps you when you are trying to figure out why your links aren't working. Have fun.
I hope that helps you when you are trying to figure out why your links aren't working. Have fun.

Revision as of 17:20, 2 May 2023

This is a new article being developed by Don Erikstrup (DErik (talk) 18:20, 2 May 2023 (PDT))

One of the confusing things about creating links to pages is that the syntax of the link reference is dependent on the "domain" of the page, which may be this instance of MediaWiki, or some other instance like Wikipedia, or MediaWiki itself (which really is its own instance of the MediaWiki application). In some instances, the full URL is needed, in others, the substitution of "mediawikiwiki:" for "https://MediaWiki.org/" works, and others do not require either the full URL or the substitution. For example: the "Special" page that lists all the pages in this instance of MediaWiki (i.e., the RCGRS.com version) has the full URL of

https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPageshttps://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages

and it can be included in any page just that way. It can also be referenced with single or double brackets around it like so:

[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages][1]

[[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages]] ⟹ [[2]]

But note that using double brackets kind of ignores the second set, taking it as additional text around the reference.
Also, those last two examples could include text that replaces the reference text. This is called "link text" in some of the help files). Here are examples with "link text":

[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages List all pages]List all pages

[[https://www.rcgrs.com/mrtwiki/index.php?title=Special:AllPages|List all pages]] ⟹ [List all pages]

Now, because these are full URLs (they include the communications protocol specification of https://) they are treated as external links. But the "Special" pages are typically internal pages. That is, they are specific to this instance of the MediaWiki installation. Note that the URL has www.rcgrs.com/mrtwiki/index.php?title= as part of the it. The part that specifies this is the rcgrs.com domain is how we know it is really specific to this MediaWiki installation instance; other instances have different domains. So, since it is internal, it can be referenced with just the page title, with or without additional text, wrapped in double square brackets, like so:

[[Special:AllPages]]Special:AllPages

[[Special:AllPages|List all pages]]List all pages

But trying to reference an internal page with just one set of square brackets, here's what happens:

[Special:AllPages] ⟹ [Special:AllPages]

[Special:AllPages|List all pages] ⟹ [Special:AllPages|List all pages]

Well that didn't work at all. It doesn't even recognize it as a link.

Let's try doing the last form to reference the MediaWiki main help file, which is external:

[Help:Contents|Attempt to display MediaWiki help] ⟹ [Help:Contents|Attempt to display MediaWiki help]

It again doesn't even recognize it as a link. So wrap it in another set of square brackets, since it is an external page:

[[Help:Contents|Attempt to display MediaWiki help]]Attempt to display MediaWiki help

It at least recognized it as a link, but note that the reference is in red letters. This indicates the page could not be found by MediaWiki. Why? Because it needs the protocol (at least a double slash ("//"), I think they assume the "http:" or "https:" if just the "//" is present - I recall reading that somewhere) and domain specified. Let's try it again with that added:

[https://www.MediaWiki.org/Help:Contents|Attempt to display MediaWiki help]Attempt to display MediaWiki help

Well, that recognized it as a link reference, but the link doesn't work (not found error). Why? Because MediaWiki actually puts this stuff in a directory called wiki. So we need to include that in the link text:

[https://www.MediaWiki.org/wiki/Help:Contents|Attempt to display MediaWiki help]Attempt to display MediaWiki help

How did I know it was in that wiki directory? I had looked up help via some other link and took note of the actual URL. Also, when I got the "404 Not found" error, the page asked if I really meant wiki/Help:Contents. That was nice of them.

Now recall my mention of "mediawikiwiki:"? Let's try substituting that for the protocol and MediaWiki domain specification in a reference to their help file. First the full reference as it would normally be done:

[http://www.MediaWiki.org/wiki/Help:Contents Attempt to display MediaWiki help]Attempt to display MediaWiki help

Now the revised reference:

[[MediaWikiwiki:Help:Contents|Attempt to display MediaWiki help]]Attempt to display MediaWiki help

Note that reference is now wrapped in double square brackets and the "link text" is delimited with a pipe ("|") rather than a space. This is because it is now considered an internal reference, and must therefore follow that syntax.

I hope that helps you when you are trying to figure out why your links aren't working. Have fun.