Difference between revisions of "Template:FULLBASEPAGENAME"

From blackwiki
Jump to navigation Jump to search
test>Amalthea
(Make it work with an empty parameter (fall back on current page))
test>Amalthea
(extend to work correctly in namespaces with subpages disabled)
Line 1: Line 1:
{{#if: {{#titleparts:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}|-1}} | {{#titleparts:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}|-1}} | {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}} }}<noinclude>
+
{{#if: {{Is subpage namespace | {{#if:{{{1|}}}|{{NAMESPACE:{{{1}}}}}|{{NAMESPACE}}}} }}
 +
  | {{#if: {{#titleparts:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}|-1}} | {{#titleparts:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}|-1}} | {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}} }}
 +
  | {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}
 +
}}<noinclude>
  
 
{{documentation}}
 
{{documentation}}
  
 
</noinclude>
 
</noinclude>

Revision as of 09:14, 28 April 2009

Template:FULLBASEPAGENAME

50px Template documentation[view] [edit] [history] [purge]

Get the namespace and the base page name of a page. It is similar to the template {{FULLROOTPAGENAME}}, but returns the parent of the page hierarchy instead of the root.

It is basically equivalent to using the magic word {{NAMESPACE}}:{{BASEPAGENAME}}.

Usage

  • {{FULLBASEPAGENAME}} → Template:FULLBASEPAGENAME
  • {{FULLBASEPAGENAME|Template:1x/sandbox}} → Template:1x
  • {{FULLBASEPAGENAME|Wikipedia:Administrators' noticeboard/Arbitration enforcement/Archive1}} → wikipedia:Administrators' noticeboard/Arbitration enforcement

In namespaces with subpages disabled, it will return the full page name:

Note that this template can be substituted.

See also