Template:Page other


Template documentation[view] [edit] [history] [purge]


This is the Wikisource {{Page other}} template.

This template helps other templates detect if they are being displayed on a proofreading page ("Page:" space) or some "other" place (such as the main space).

It effectively mirrors the functionality of <noinclude></noinclude> on a proofread page, by allowing templates to display something only on the proofread page, but not allowing this to be transcluded.

UsageEdit

This template usually takes two parameters, like this:

{{page other | Page text | Other pages text }}

If the template is on a proofread page (i.e. in the "Page:" space), it will return this:

Page text

If the template is on any other page, it will return this:

Other pages text

A typical usage case could be to make it so that a template only displays footnotes only when on an proofread page. When transcluded into the mainspace, footnotes are added after the transcluded text so they all display at the end rather than page by page. Normally this is done by using <noinclude></noinclude> tags, but in some cases you may want to display footnotes through a template. Like this:

  • Example footnote ("Footnote text")[1]
{{page other | {{reflist}} }}

If the template is on a proofread page (i.e. in the "Page:" space), it will return this:

  1. "Footnote text"

Note that in the case above the "other" parameter was not used. To display something only when not on a proofread page, the "page" parameter can be left empty.

DemospaceEdit

For testing and demonstration purposes this template can take a parameter named demospace.

  • If it has the value page it returns the article text.
  • If it has the value other or any other value such as the name of some other namespace it returns the other pages text.
  • If the parameter is empty or undefined, the actual page type determines the result.

Like this:

{{page other 
| Page text 
| Other pages text 
| demospace = main
}}

No matter on what kind of page the code above is used it will return this:

Other pages text

You can make it so your template also understands the demospace parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:

{{page other 
| Page text 
| Other pages text 
| demospace = {{{demospace|}}}
}}


See alsoEdit