Jump to content

Template:ReturnToParent: Difference between revisions

From Kid Dancers Wiki
No edit summary
No edit summary
Line 1: Line 1:
[[{{{1|{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}|{{{2|Return to {{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}]]
<noinclude>
This template creates a link to return to the parent page.
 
== Usage ==
; Automatic parent detection
: <code><nowiki>{{Return to parent}}</nowiki></code>
: Automatically detects the parent page from the current page name.
: Example: On "Help/Subpage" it displays "Return to Help"
 
; Specify custom parent page
: <code><nowiki>{{Return to parent|CustomPage}}</nowiki></code>
: Links to the specified page instead.
: Example: <code><nowiki>{{Return to parent|Main Page}}</nowiki></code>
 
; Custom link text
: <code><nowiki>{{Return to parent|parent=Help|text=Back to Help}}</nowiki></code>
: Allows customizing both the parent page and the link text.
 
== Examples ==
* <code><nowiki>{{Return to parent}}</nowiki></code>
* <code><nowiki>{{Return to parent|Help}}</nowiki></code>
* <code><nowiki>{{Return to parent|parent=Portal:Contents|text=← Back to Contents}}</nowiki></code>
 
[[Category:Navigation templates]]
</noinclude><includeonly>{{#if:{{{parent|}}}|<!--
  -->{{#if:{{{text|}}}|<!--
    -->[[{{{parent}}}|{{{text}}}]]|<!--
    -->[[{{{parent}}}|← Return to {{{parent}}}]]}}|<!--
  -->{{#if:{{{1|}}}|<!--
    -->[[{{{1}}}|← Return to {{{1}}}]]|<!--
    -->{{#ifeq:{{NAMESPACE}}||<!--
      -->{{#ifexpr:{{PAGESIZE:{{BASEPAGENAME}}}} > 0|<!--
        -->[[{{BASEPAGENAME}}|Return to {{BASEPAGENAME}}]]|<!--
        --><span class="error">No parent page found</span>}}|<!--
      -->{{#ifexpr:{{PAGESIZE:{{NAMESPACE}}:{{BASEPAGENAME}}}} > 0|<!--
        -->[[{{NAMESPACE}}:{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]|<!--
        --><span class="error">No parent page found</span>}}}}}}}}</includeonly>

Revision as of 03:39, 30 November 2025

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

Usage

Automatic parent detection
{{Return to parent}}
Automatically detects the parent page from the current page name.
Example: On "Help/Subpage" it displays "Return to Help"
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

  • {{Return to parent}}
  • {{Return to parent|Help}}
  • {{Return to parent|parent=Portal:Contents|text=← Back to Contents}}