This site is supported by donations to The OEIS Foundation.

Template:Subpage name

From OeisWiki
Jump to: navigation, search

The {{subpage name}} workaround template gives the last title part (i.e. the current part) of either {{PAGENAME}} or {{PAGENAMEE}} (URL encoded option). It should be used when the {{SUBPAGENAME}} or {{SUBPAGENAMEE}} (URL encoded version) magic words don't work properly, i.e. in a namespace that doesn't have its subpages enabled (e.g. the Template namespace).

NOTE: The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See Manual:$wgNamespacesWithSubpages for information on enabling subpages.

For example

{{SUBPAGENAME}}

gives the wrong result (if viewed from {{subpage name/doc}})

Subpage name

while using

{{subpage name}}

we get the desired result

Subpage name

See {{Citation/make link/doc}} for an example with 2 levels of subpages (the test is commented out, just temporarily uncomment to redo the test, but do not save).

Note that if there is no parent page, the subpage name is the same as the page name.

URL encoded

NOTE: The {{BASEPAGENAMEE}} and {{SUBPAGENAMEE}} magic words only work in namespaces that have subpages enabled. See Manual:$wgNamespacesWithSubpages for information on enabling subpages.

For example

{{SUBPAGENAMEE}}

gives the wrong result (if viewed from {{subpage name/doc}})

Subpage_name

while using

{{subpage name|e}} or {{subpage name|encoded}} or {{subpage name|URL encoded}}

we get the desired result

Subpage name

See {{Citation/make link/doc}} for an example with 2 levels of subpages (the test is commented out, just temporarily uncomment to redo the test, but do not save).

Note that if there is no parent page, the subpage name is the same as the page name.

Code

<noinclude>{{Documentation}}</noinclude><includeonly>{{#switch: {{lc: {{{1|}}} }}
| url encoded | encoded | e = {{#explode: {{PAGENAMEE}}|/|-1}}
| #default = {{#explode: {{PAGENAME}}|/|-1}}
}}</includeonly>

See also

External links