Jump to content

Template:ReturnToParent: Difference between revisions

From Kid Dancers Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
: <code><nowiki>{{Return to parent}}</nowiki></code>
: <code><nowiki>{{Return to parent}}</nowiki></code>
: Automatically detects the parent page from the current page name.
: Automatically detects the parent page from the current page name.
: Example: On "Help/Subpage" it displays "Return to Help"
: Example: On "Paige Hyland/Gallery" it displays "Return to Paige Hyland"


; Specify custom parent page
; Specify custom parent page
Line 30: Line 30:
|{{#if:{{{1|}}}
|{{#if:{{{1|}}}
|[[{{{1}}}|← Return to {{{1}}}]]
|[[{{{1}}}|← Return to {{{1}}}]]
|{{#ifeq:{{NAMESPACE}}|
|{{#if:{{#invoke:ParentPage|getParent}}
|{{#if:{{BASEPAGENAME}}
|[[{{#invoke:ParentPage|getParent}}|← Return to {{#invoke:ParentPage|getParentName}}]]
|[[{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]
|<span class="error">This is not a subpage</span>
|<span class="error">No parent page found</span>
}}
|[[{{NAMESPACE}}:{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]
}}
}}
}}
}}
}}</includeonly>
}}</includeonly>

Latest revision as of 03:47, 30 November 2025

This template creates a link to return to the parent page.

Automatic parent detection
{{Return to parent}}
Automatically detects the parent page from the current page name.
Example: On "Paige Hyland/Gallery" it displays "Return to Paige Hyland"
Specify custom parent page
{{Return to parent|CustomPage}}
Links to the specified page instead.
Example: {{Return to parent|Main Page}}
Custom link text
{{Return to parent|parent=Help|text=Back to Help}}
Allows customizing both the parent page and the link text.

Examples

[edit source]
  • {{Return to parent}}
  • {{Return to parent|Help}}
  • {{Return to parent|parent=Portal:Contents|text=← Back to Contents}}