Template:PAGENAMEBASE/doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Documentation subpage}} {{Wikipedia template}} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox| | <!-- Categories and interwikis go here. --> }}</includeonly>") |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
{{ | {{Lua|Module:String}} | ||
< | This template returns the current page name without text in parentheses. If the page name has more than one set of parentheses, only the last one is removed. | ||
It is not to be confused with the [[Help:Magic words|magic word]], <code><nowiki>{{BASEPAGENAME}}</nowiki></code>, which returns the page name without its subpages. | |||
==Usage== | |||
<code><nowiki>{{PAGENAMEBASE}}</nowiki></code> | |||
The first unnamed parameter can be used to specify the page name. Otherwise, it defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>. | |||
===Examples=== | |||
<code><nowiki>{{PAGENAMEBASE|Blight (game mechanic)}}</nowiki></code> → {{PAGENAMEBASE|Blight (game mechanic)}} | |||
<code><nowiki>{{PAGENAMEBASE|Blight league}}</nowiki></code> → {{PAGENAMEBASE|Blight league}} | |||
<code><nowiki>{{PAGENAMEBASE|Map:Harbinger Map (Low Tier) (Blight)}}</nowiki></code> → {{PAGENAMEBASE|Map:Harbinger Map (Low Tier) (Blight)}} | |||
{{Adapted from Wikipedia|Template:PAGENAMEBASE}} | |||
{{Documentation categories| | |||
<!-- Categories and interwikis go here. --> | <!-- Categories and interwikis go here. --> | ||
[[Category:Templates]] | |||
}} | }} |
Latest revision as of 18:10, 2 May 2024
This subpage provides documentation for Template:PAGENAMEBASE.
This template returns the current page name without text in parentheses. If the page name has more than one set of parentheses, only the last one is removed.
It is not to be confused with the magic word, {{BASEPAGENAME}}
, which returns the page name without its subpages.
Usage
{{PAGENAMEBASE}}
The first unnamed parameter can be used to specify the page name. Otherwise, it defaults to {{PAGENAME}}
.
Examples
{{PAGENAMEBASE|Blight (game mechanic)}}
→ Blight
{{PAGENAMEBASE|Blight league}}
→ Blight league
{{PAGENAMEBASE|Map:Harbinger Map (Low Tier) (Blight)}}
→ Map:Harbinger Map (Low Tier)
This template was adapted from Template:PAGENAMEBASE on Wikipedia.
Adaptation is noted for reference and attribution only. This template may differ from the original in function or in usage.
Adaptation is noted for reference and attribution only. This template may differ from the original in function or in usage.