• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Wikipedia other

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here


Template documentation[view] [edit] [history] [purge]
Shortcut
  • {{ns4}}
Not to be confused with {{WikipediaOther}}.
WarningThis template is used on approximately 15,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.

This is the {{wikipedia other}} meta-template.

This template helps other templates detect if they are on a "Wikipedia:" page or some "other" type of page.

Usage

This template usually takes two parameters, like this:

{{wikipedia other | Wikipedia page text | Other pages text }}

If the template is on a "Wikipedia:" page, it will return this:

Wikipedia 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 adds a category when on "Wikipedia:" pages. Thus not adding other pages that just show the template. Like this:

{{wikipedia other | [[Category:Some Wikipedia project category]] }}

Or to warn that a template should not be used on other pages:

{{wikipedia other | | This template should only be used on "Wikipedia:" pages. }}

Note that in the first case above the "other" parameter was not used, and in the second example the "wikipedia" parameter was left empty.

Demospace

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

  • If it has the value wikipedia it returns the Wikipedia page text.
  • It if 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:

{{wikipedia other 
| Wikipedia page text 
| Other pages text 
| demospace = wikipedia
}}

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

Wikipedia page 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:

{{wikipedia other 
| Wikipedia page text 
| Other pages text 
| demospace = {{{demospace|}}}
}}

Technical details

This template detects "Wikipedia talk:" pages as type other.

This template works like {{main talk other}}, for more examples and technical details see full documentation there.


  • v
  • t
  • e
Namespace and pagename-detecting templates
Namespace
Particular
  • Main other
  • Talk other
  • Category other
  • Draft other
  • File other
    • Is Commons
  • Help other
  • Module other
  • Portal other
  • Template other
  • User other
  • Wikipedia other
  • Single namespace
  • If talkspace of
  • If usertalk of
More generic
  • Namespace detect
  • Namespace detect showall
  • Main talk other
    • Main talk other flex
  • Talkspace detect
Pagename
When on basepage
Detects and acts according to whether it is on a basepage or on any subpage (that is, a ../.. subpage).
When pagename is
For pattern matching on the pagename.
Module:Page
Can take apart and put together pagenames in several ways.
IP-talk
Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
IP-user other
For detecting IP-user pages.
Subpage other
Pagename has an after-slash part (not in mainspace)
Sandbox other
Page is subpage /sandbox (template space)
Testcases other
Page is subpage /testcases (template space)
Rootpage other
Page is rootpage (vs. /subpage) (template space)
Others
Stub other
Detects whether it is on a page with a stub template or not.
If preview
Detects whether page is viewed as a preview or not.
If IP
Displays different content to IP users and logged-in users.
If autoconfirmed
Displays different content to autoconfirmed and non-autoconfirmed users.
If extended confirmed
Displays different content to extended confirmed and non-extended confirmed users.
If administrator
Displays content only to admins.
If mobile
Displays different content to mobile users and desktop users.
If checkuser
Displays content only to checkusers.
Noscript
Detects whether page is viewed with a JavaScript-capable client or not.
  • Wikipedia:Namespace
  • Wikipedia:Page name
  • Magic words
  • ParserFunctions
The above documentation is transcluded from Template:Wikipedia other/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Wikipedia_other&oldid=39437"
Categories:
  • Navboxes using background colours
  • Namespace manipulation templates
  • Wikipedia namespace templates
Last edited on 8 December 2019, at 20:20

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 8 December 2019, at 20:20.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop