yes
This is the template sandbox page for Template:Ns has subpages (diff). See also the companion subpage for test cases. |
This template is used in system messages, and on approximately 3,040,000 pages, or roughly 5% of all pages. Changes to it can cause immediate changes to the Wikipedia user interface. 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. Please discuss changes on the talk page before implementing them. Preview message: Transclusion count updated automatically (see documentation). |
This template can only be edited by administrators because it is transcluded onto one or more cascade-protected pages. |
This template uses Lua: |
Detects whether the current or the given namespace has subpages enabled. Returns "yes" if it does, and an empty string otherwise.
This template can be substituted.
{{ns has subpages}}
→ yes{{ns has subpages|Template}}
→ yes{{ns has subpages|Category}}
→ yes{{ns has subpages|}}
(main space) →{{ns has subpages|{{ns:0}}}}
(main space) →{{ns has subpages|:}}
(main space) →{{ns has subpages|{{ns:Talk}}}}
→ yes{{ns has subpages|Category talk}}
→ yes{{ns has subpages|File:Foo}}
→{{ns has subpages|Foo}}
→{{ns has subpages|:Template}}
→ yes{{namespace detect}}