Template:Page other/doc

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  on a proofread page, by allowing templates to display something only on the proofread page, but not allowing this to be transcluded.

Usage
This template usually takes two parameters, like this:

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



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



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  tags, but in some cases you may want to display footnotes through a template. Like this:


 * Example footnote ("Footnote text")

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

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.

Demospace
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:

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



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: