• Home
  • Random
  • Recent changes
  • Special pages
  • Community portal
  • Settings
  • About Consumer Rights Wiki
  • Disclaimers
Consumer Rights Wiki
  • Talk
  • Contributions
  • Create account
  • Log in

Template:Single namespace

  • Template
  • Discussion
  • Language
  • Watch
  • View history
  • Edit
    • What links here
    • Permanent link
    • Page information
    • Edit full page


Template documentation[view] [edit] [history] [purge]
WarningThis template is used on many 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 template should not be substituted.

Contents

  • 1 Usage
  • 2 Examples
    • 2.1 Correct namespace
    • 2.2 Incorrect namespace
  • 3 Supporting templates
  • 4 See also

Usage

edit

This is a meta-template; it should only be used within other templates. It is used for namespace detection as a simplification of {{Foo other|Example|{{Incorrect namespace|foo}}}}. If the template is transcluded in the Foo namespace, it will transclude "Example"; if not, it will transclude {{Incorrect namespace }}. Note that {{Incorrect namespace }} does not work in the template namespace.

The first parameter is necessary. It defines which namespace is the correct namespace for the template.

The second parameter is optional. It allows something (usually a category) to be transcluded in the correct namespace.

Examples

edit

Correct namespace

edit

{{Single namespace|Template|This text is only displayed in the Template namespace}}

This text is only displayed in the Template namespace

Incorrect namespace

edit

{{Single namespace|Category|This text is only displayed in the Category namespace}}

The above template should only be transcluded in the Category namespace(s).

Supporting templates

edit

Template:Flatlist

See also

edit
  • Template:Category handler
  • Template:Namespace detect
The above documentation is transcluded from Template:Single namespace/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://mirror.consumerrights.wiki/index.php?title=Template:Single_namespace&oldid=18678"
Categories:
  • Pages with broken file links
  • Wikipedia never-substituted templates
  • Template namespace templates
Hidden category:
  • Pages with script errors
Last edited on 13 August 2025, at 05:24

Languages

    This page is not available in other languages.

    Consumer Rights Wiki
    • Creative Commons Attribution-ShareAlike 4.0 International
    • Powered by MediaWiki
    • This page was last edited on 13 August 2025, at 05:24.
    • Content is available under Creative Commons Attribution-ShareAlike 4.0 International unless otherwise noted.
    • All submissions to the site are subject to the wiki's licence, CC 4.0 BY-SA, as found here
    • Privacy policy
    • About Consumer Rights Wiki
    • Disclaimers
    • Desktop