Template:GetSubpage: Difference between revisions

From Karteria DWRP Wiki
Jump to navigationJump to search
Icie (talk | contribs)
Created page with "{{#ifeq:{{BASEPAGENAME}}|{{FULLPAGENAME}}|{{FULLPAGENAME}}|{{#invoke:String|sub|{{{1}}}|{{#expr:{{#invoke:String|len|{{BASEPAGENAME}}}}+2}}}}}}"
 
Icie (talk | contribs)
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifeq:{{BASEPAGENAME}}|{{FULLPAGENAME}}|{{FULLPAGENAME}}|{{#invoke:String|sub|{{{1}}}|{{#expr:{{#invoke:String|len|{{BASEPAGENAME}}}}+2}}}}}}
<includeonly>{{#ifeq:{{{2|}}}|category|{{#ifeq:{{#invoke:String|find|{{{1|}}}|:}}|0|{{{1|}}}|{{#invoke:String|sub|{{{1}}}|{{#expr:{{#invoke:String|find|{{{1|}}}|:}}+1}}}}}}|{{#ifeq:{{#invoke:String|find|{{{1|}}}|/}}|0|{{{1|}}}|{{#invoke:String|sub|{{{1}}}|{{#expr:{{#invoke:String|find|{{{1|}}}|/}}+1}}}}}}}}</includeonly><noinclude>
{{Documentation}}</noinclude>

Latest revision as of 05:32, 16 January 2026

Template documentation

Returns the subpage portion of given text eg: {{GetSubpage|Test Drive Meme - March 2025/FAQ Page}} gives FAQ Page

Use category to return the name portion of a category eg {{GetSubpage|Category:Test Drive Meme|category}} gives Test Drive Meme

Gives the subpage portion of the provided text

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Page name to retrieve the subpage from1

no description

Page namerequired
type2

if "category" extracts the name of the category

Suggested values
category
Stringoptional