Difference between revisions of "Template:BASEPAGENAME"
From Project: Gorgon Wiki
m (Added See also for other version) |
m (Final fix with status display on template page only) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | <noinclude>{{ | + | <noinclude>Subpage functionality is {{ |
| − | </noinclude>{{ | + | #ifeq: {{BASEPAGENAME:{{{1|{{FULLPAGENAME}}/1 1/2 2}}}}} | {{PAGENAME:{{{1|{{FULLPAGENAME}}/1 1/2 2}}} }} |
| − | #if: {{#titleparts: {{PAGENAME}} |-1}} | + | | <b>DISABLED</b>:<br/> |
| − | | {{#titleparts: {{PAGENAME}} |-1}} | + | | <b>ENABLED</b>:<br/> |
| − | | | + | }}</noinclude>{{ |
| − | + | #ifexpr: <!-- Check if subpage part is present --> | |
| − | + | 1 and {{#if: {{#titleparts:{{PAGENAME:{{{1|{{FULLPAGENAME}}}}} }}|-1}} |1|0}} | |
| − | + | | <noinclude>Subpage part <b><i>is</i></b> present.<br/>"</noinclude | |
| − | + | >{{#titleparts:{{PAGENAME:{{{1|{{FULLPAGENAME}}}}} }}|-1}} | |
| − | + | | <noinclude>Subpage part is <b><i>not</i></b> present.<br | |
| − | + | />Returning <code><nowiki>{{</nowiki>ROOTPAGENAME:<var>Pagename</var><nowiki>}}</nowiki></code> even for MediaWiki versions <1.22<br/>"</noinclude | |
| − | + | >{{#titleparts:{{PAGENAME:{{{1|{{FULLPAGENAME}}}}} }}|1}} | |
| − | + | }}<noinclude>" | |
| − | + | {{documentation}} | |
| − | ; | ||
| − | |||
| − | }} | ||
| − | |||
</noinclude> | </noinclude> | ||
Latest revision as of 04:48, 27 April 2016
Subpage functionality is ENABLED:
Subpage part is not present.
Returning {{ROOTPAGENAME:Pagename}} even for MediaWiki versions <1.22
"BASEPAGENAME"
Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
| This template was copied from Template:BASEPAGENAME on Wikia Templates. That wiki should periodically be checked for a new version of this template. |
- Description
- This is a drop-in functionality for wikis that don't have Subpages enabled.
- This documentation is shared between templates affected by this, see the See also section at bottom.
- Usage
- To make use of the same functionality as the magic-word using a template with same name if it exists.
- Use
{{msg:BASEPAGENAME}}inplace of{{BASEPAGENAME}} - Or
{{msg:BASEPAGENAME|Pagename}}inplace of{{BASEPAGENAME:Pagename}}to provide a pagename to operate upon. - If no Pagename is provided it defaults to {{FULLPAGENAME}}.
- Use
| code | result | |
|---|---|---|
| input | Template:(((1|{{FULLPAGENAME}}}}}
|
Template:BASEPAGENAME
|
| Tinput | Template:(((1|{{FULLPAGENAME}}/1 1/2 2}}}
|
Template:BASEPAGENAME/1 1/2 2
|
| NAMESPACE | {{NAMESPACE}}
|
Template
|
| PAGENAME | {{PAGENAME:input }}
|
BASEPAGENAME
|
{{PAGENAME:Tinput }}
|
BASEPAGENAME/1 1/2 2
| |
| #titleparts: |1 | {{#titleparts:{{PAGENAME:input }}|1}}
|
BASEPAGENAME
|
{{#titleparts:{{PAGENAME:Tinput }}|1}}
|
BASEPAGENAME
| |
| #titleparts: |-1 | {{#titleparts:{{PAGENAME:input }}|-1}}
|
|
{{#titleparts:{{PAGENAME:Tinput }}|-1}}
|
BASEPAGENAME/1 1
| |
| #titleparts: ||-1 | {{#titleparts:{{PAGENAME:input }}||-1}}
|
BASEPAGENAME
|
{{#titleparts:{{PAGENAME:Tinput }}||-1}}
|
2 2
|
| functionality | code | result |
|---|---|---|
| BASEPAGENAME | {{BASEPAGENAME:input}}
|
BASEPAGENAME
|
{{BASEPAGENAME:Tinput}}
|
BASEPAGENAME/1 1
| |
| msg:BASEPAGENAME | {{msg:BASEPAGENAME|input}}
|
BASEPAGENAME
|
{{msg:BASEPAGENAME|Tinput}}
|
BASEPAGENAME/1 1
|
- Dependencies
- {{((}}, {{(((}}, {{))}}, {{)))}} and {{SPW}} to provide this documentation.
- MediaWiki Help:Magic words#Transclusion modifiers For the msg MAGICWORD.
- MediaWiki Help:Magic words#Page names.
- MediaWiki Help:Extension:ParserFunctions##titleparts for logic used in the functionality.
- See also
The above text is transcluded from Template:BASEPAGENAME/doc; you can change it or view its history.
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:BASEPAGENAME/doc. (View all subpages of this page.)
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:BASEPAGENAME/doc. (View all subpages of this page.)