Jump to content

Template:ReturnToParent: Difference between revisions

From Kid Dancers Wiki
No edit summary
No edit summary
Line 23: Line 23:


[[Category:Navigation templates]]
[[Category:Navigation templates]]
</noinclude><includeonly>{{#if:{{{parent|}}}|<!--
</noinclude><includeonly>{{#if:{{{parent|}}}
  -->{{#if:{{{text|}}}|<!--
|{{#if:{{{text|}}}
    -->[[{{{parent}}}|{{{text}}}]]|<!--
|[[{{{parent}}}|{{{text}}}]]
    -->[[{{{parent}}}|← Return to {{{parent}}}]]}}|<!--
|[[{{{parent}}}|← Return to {{{parent}}}]]
  -->{{#if:{{{1|}}}|<!--
}}
    -->[[{{{1}}}|← Return to {{{1}}}]]|<!--
|{{#if:{{{1|}}}
    -->{{#ifeq:{{NAMESPACE}}||<!--
|[[{{{1}}}|← Return to {{{1}}}]]
      -->{{#ifexpr:{{PAGESIZE:{{BASEPAGENAME}}}} > 0|<!--
|{{#ifeq:{{NAMESPACE}}|
        -->[[{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]|<!--
|{{#if:{{BASEPAGENAME}}
        --><span class="error">No parent page found</span>}}|<!--
|[[{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]
      -->{{#ifexpr:{{PAGESIZE:{{NAMESPACE}}:{{BASEPAGENAME}}}} > 0|<!--
|<span class="error">No parent page found</span>
        -->[[{{NAMESPACE}}:{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]|<!--
}}
        --><span class="error">No parent page found</span>}}}}}}}}</includeonly>
|[[{{NAMESPACE}}:{{BASEPAGENAME}}|← Return to {{BASEPAGENAME}}]]
}}
}}
}}</includeonly>

Revision as of 03:41, 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}}