Difference between revisions of "Template:Mediawiki"

From FamiLAB Wiki
Jump to: navigation, search
(Solve the space encoding issue with interwiki link to 'mediawikiwiki' (included in default install of 1.15.1))
(not every wiki has that interwiki set up)
Line 3: Line 3:
 
| www.mediawiki.org
 
| www.mediawiki.org
 
| [[{{{1}}}|{{{2|{{{1}}}}}}]]
 
| [[{{{1}}}|{{{2|{{{1}}}}}}]]
| [[mediawikiwiki:{{{1}}}|{{{2|{{{1}}}}}}]]
+
| [http://www.mediawiki.org/wiki/{{urlencode:{{{1}}}}} {{{2|{{{1}}}}}}]
 
}}<noinclude>
 
}}<noinclude>
 
----
 
----
This template links to a page on mediawiki.org from the [[Help:Contents|Help pages]]. The template has two parameters:
+
This template links to a page on from the [[Help:Contents|Help pages]]. The template has two parameters:
 
# Pagename, optionally preceded by an interwiki link prefix valid on mediawiki.org
 
# Pagename, optionally preceded by an interwiki link prefix valid on mediawiki.org
 
# (optional) Link description
 
# (optional) Link description
Line 14: Line 14:
 
| www.mediawiki.org
 
| www.mediawiki.org
 
| This is so that the public domain help pages - which can be freely copied and included in other sites - have correct links to Mediawiki:
 
| This is so that the public domain help pages - which can be freely copied and included in other sites - have correct links to Mediawiki:
* on external sites, it creates an interwiki link to 'mediawikiwiki' (included in the default interwiki table for new installs)
+
* on external sites, it creates an external link
 
* on Mediawiki, it creates an internal or interwiki link
 
* on Mediawiki, it creates an internal or interwiki link
  
 
'''All''' links from the Help namespace to other parts of the mediawiki.org wiki should use this template.}}
 
'''All''' links from the Help namespace to other parts of the mediawiki.org wiki should use this template.}}
 +
 +
== Spaces in Page Titles ==
 +
These '''must''' be replaced with underscores, otherwise the urlencoding mangles them and you get a page not found error on mediawiki.org.
 +
 +
So need <nowiki>{{Mediawiki|Page_Title}}</nowiki> not <nowiki>{{Mediawiki|Page Title}}</nowiki>
  
 
== Demo of interwiki link ==
 
== Demo of interwiki link ==
  
 
<nowiki>
 
<nowiki>
{{mediawiki|m:Help:Calculation|Help:Calculation}}</nowiki> gives either <nowiki>[[m:Help:Calculation|Help:Calculation]] or [[mediawikiwiki:m:Help:Calculation|Help:Calculation]]</nowiki>.  
+
{{mediawiki|m:Help:Calculation|Help:Calculation}}</nowiki> gives either <nowiki>[[m:Help:Calculation|Help:Calculation]] or [http://www.mediawiki.org/wiki/m%3AHelp%3ACalculation Help:Calculation]</nowiki>, rendered as [[m:Help:Calculation|Help:Calculation]] or [http://www.mediawiki.org/wiki/m%3AHelp%3ACalculation Help:Calculation], respectively.  
  
 
[[Category:Info templates|MediaWiki]]
 
[[Category:Info templates|MediaWiki]]
 
</noinclude>
 
</noinclude>

Revision as of 05:47, 20 November 2009

{{ #ifeq:

 old.familab.org

| www.mediawiki.org | [[{{{1}}}|{{{1}}}]] | {{{1}}} }}


This template links to a page on from the Help pages. The template has two parameters:

  1. Pagename, optionally preceded by an interwiki link prefix valid on mediawiki.org
  2. (optional) Link description

{{ #ifeq: old.familab.org | www.mediawiki.org | This is so that the public domain help pages - which can be freely copied and included in other sites - have correct links to Mediawiki:

  • on external sites, it creates an external link
  • on Mediawiki, it creates an internal or interwiki link

All links from the Help namespace to other parts of the mediawiki.org wiki should use this template.}}

Spaces in Page Titles

These must be replaced with underscores, otherwise the urlencoding mangles them and you get a page not found error on mediawiki.org.

So need {{Mediawiki|Page_Title}} not {{Mediawiki|Page Title}}

Demo of interwiki link

{{mediawiki|m:Help:Calculation|Help:Calculation}} gives either [[m:Help:Calculation|Help:Calculation]] or [http://www.mediawiki.org/wiki/m%3AHelp%3ACalculation Help:Calculation], rendered as Help:Calculation or Help:Calculation, respectively.