Jump to content

Template:Pagetype: Difference between revisions

From WikiGenius
Created page with "{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude> {{documentation}} <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude>"
 
Shovon (talk | contribs)
m Protected "Template:Pagetype" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
<includeonly>{{#switch:{{NAMESPACE}}
{{documentation}}
| ={{#ifexist:{{FULLPAGENAME}}|article|page}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
| Talk=talk page
| User=user page
| User talk=user talk page
| Wikipedia=project page
| Wikipedia talk=project talk page
| File=file page
| File talk=file talk page
| MediaWiki=system message
| MediaWiki talk=system message talk page
| Template=template
| Template talk=template talk page
| Help=help page
| Help talk=help talk page
| Category=category
| Category talk=category talk page
| Portal=portal
| Portal talk=portal talk page
| Book=book
| Book talk=book talk page
| Draft=draft
| Draft talk=draft talk page
| TimedText=TimedText page
| TimedText talk=TimedText talk page
| Module=module
| Module talk=module talk page
| Gadget=gadget
| Gadget talk=gadget talk page
| Gadget definition=gadget definition page
| Gadget definition talk=gadget definition talk page
| Special=special page
| Media=media page
| #default=page
}}</includeonly><noinclude>
This template returns the page type (e.g., article, talk page, user page) based on the namespace.
Used in documentation and templates to adapt wording.
 
==Usage==
<pre>
{{pagetype}}
</pre>
 
It automatically adjusts to the current page's type.
 
[[Category:Utility templates]]
</noinclude>
</noinclude>

Latest revision as of 09:38, 5 June 2025

This template returns the page type (e.g., article, talk page, user page) based on the namespace. Used in documentation and templates to adapt wording.

Usage

{{pagetype}}

It automatically adjusts to the current page's type.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.