Template:EmbeddedSubpageLink: Difference between revisions
Created page with "<includeonly>[[{{{1}}}{{#switch:{{SUBPAGENAME}}|{{{2}}}=/|#}}{{{2}}}|{{{2}}}]]</includeonly><noinclude> Link to Patterns#Embedded Subpages nicely for Navboxes and other cases where showing if it is a link to the current page is important. Example: {{EmbeddedSubpageLink|Outer_Wilds|Echoes_of_the_Eye}} <templatedata> { "params": { "1": { "label": "Parent Page", "description": "The name of the parent page.", "type": "wiki-page-name", "required": tru..." |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>[[{{{1}}}{{#switch:{{SUBPAGENAME}}|{{{2}}}=/|#}}{{{2}}}|{{{2}}}]]</includeonly><noinclude> | <includeonly>[[{{{1}}}{{#switch:{{SUBPAGENAME}}|{{{2}}}=/|#}}{{{2}}}|{{{3|{{{2}}}}}}]]</includeonly><noinclude> | ||
Link to [[Patterns#Embedded Subpages]] nicely for Navboxes and other cases where showing if it is a link to the current page is important. | Link to [[Editing_Guide/Patterns#embedded subpages|Embedded Subpages]] nicely for Navboxes and other cases where showing if it is a link to the current page is important. | ||
Example: | Example: | ||
{{EmbeddedSubpageLink| | <pre><nowiki>{{EmbeddedSubpageLink|Outer Wilds|Echoes of the Eye}}</nowiki></pre> | ||
{{EmbeddedSubpageLink|Outer Wilds|Echoes of the Eye}} | |||
See how this becomes a self-link when viewed on [[Outer Wilds/Echoes of the Eye]] in the navbox. | |||
<templatedata> | <templatedata> | ||
Line 19: | Line 21: | ||
"type": "string", | "type": "string", | ||
"required": true | "required": true | ||
}, | |||
"3": { | |||
"label": "Title", | |||
"description": "Used to override the text of the link, by default this will be the subpage name.", | |||
"type": "string" | |||
} | } | ||
}, | }, |