• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Single namespace

  • Template
  • Talk
  • Language
  • Watch
  • View source


Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 231,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. 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

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

Correct namespace

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

This text is only displayed in the Template namespace

Incorrect namespace

{{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

  • {{Incorrect namespace}}
  • {{Category other}}
  • {{Draft other}}
  • {{File other}}
  • {{Help other}}
  • {{Main other}}
  • {{Module other}}
  • {{Portal other}}
  • {{Talk other}}
  • {{Template other}}
  • {{User other}}
  • {{Wikipedia other}}

See also

  • 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://en.wikipedia.org/w/index.php?title=Template:Single_namespace&oldid=1304254987"
Last edited on 4 August 2025, at 23:24

Languages

    • Afrikaans
    • Аԥсшәа
    • العربية
    • Արեւմտահայերէն
    • Asturianu
    • Авар
    • Azərbaycanca
    • تۆرکجه
    • Basa Bali
    • বাংলা
    • 閩南語 / Bân-lâm-gí
    • Беларуская (тарашкевіца)
    • भोजपुरी
    • Bosanski
    • Буряад
    • Català
    • Cebuano
    • Chi-Chewa
    • Dansk
    • الدارجة
    • Ελληνικά
    • فارسی
    • Fiji Hindi
    • Føroyskt
    • Gaeilge
    • ગુજરાતી
    • 客家語 / Hak-kâ-ngî
    • 한국어
    • Hausa
    • Հայերեն
    • हिन्दी
    • Ilokano
    • Bahasa Indonesia
    • Íslenska
    • Kurdî
    • मैथिली
    • Македонски
    • മലയാളം
    • Malti
    • मराठी
    • مصرى
    • Bahasa Melayu
    • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
    • Монгол
    • မြန်မာဘာသာ
    • नेपाली
    • 日本語
    • Norsk bokmål
    • ଓଡ଼ିଆ
    • Oʻzbekcha / ўзбекча
    • ਪੰਜਾਬੀ
    • پښتو
    • Português
    • Română
    • Sakizaya
    • संस्कृतम्
    • Scots
    • සිංහල
    • Simple English
    • سنڌي
    • Slovenščina
    • کوردی
    • Српски / srpski
    • Srpskohrvatski / српскохрватски
    • Tagalog
    • தமிழ்
    • တႆး
    • ไทย
    • Türkçe
    • Українська
    • Tiếng Việt
    • 文言
    • 吴语
    • 粵語
    • Zazaki
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 4 August 2025, at 23:24 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop