• Home
  • Random
  • Log in
  • Settings
Donate Now If this site has been useful to you, please give today.
  • About Wikisource
  • Disclaimers
Wikisource

Template:Page other

  • Template
  • Discussion
  • Language
  • Watch
  • Edit
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Namespace other (sandbox)

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.

Usage

edit

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.

Demospace

edit

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 also

edit
  • {{Main other}}: for content that varies between mainspace and all other namespaces
  • {{Index other}}
  • {{Page index other}}: for content that varies between the Page: namespace, Index: namespace, and all other namespaces
  • {{Namespace detect}}: general purpose template for any content that varies between namespaces
  • {{Namespace link}}: for links that vary between namespaces
  • {{Double link}}: for links in the Page: namespace that vary when in the Page: or mainspace
  • {{Scan page link}}: for auto-offset page links in the Page: namespace, that vary when in Page: Index: or mainspace
  • {{TOC link}}: for table of contents page links in the Page: namesapce, that vary when in Page: Index: or mainspace
The above documentation is transcluded from Template:Page other/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikisource.org/w/index.php?title=Template:Page_other&oldid=14232931"
Last edited on 28 May 2024, at 20:07

Languages

    • বাংলা
    • 日本語
    • Bahasa Melayu
    • தமிழ்
    Wikisource
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 28 May 2024, at 20:07.
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikisource
    • Disclaimers
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop