Template:Link

Link is used for linking to pages of the same game (in the same hub directory), but absolute paths are enabled as well.

Contents

Usage

{{Link|Location|Optional Alternate Text}}

Replace Location with the location of the page to which you're linking, relative to the same hub directory. Replace Optional Alternate Text with what you would like the link to be named, but only do it if you're not satisfied with the default text.

Notes

  • To make a link with a path that is absolute (relative to the /wiki directory), place a forward slash before the location.
  • To link to a sub-page of a hub while on the hub, use the same syntax as if you were linking from another sub-page of the hub.
  • To link back to the hub page of the current page (if applicable), use {{Link|/}}. From an image not belonging to a hub, this will link to the Main Page.
  • You may not use Link to link to Talk pages, Images Categories, etc. Instead, use the related Core Templates, such as Template:Talk, Template:Image, Template:Cat, etc.
  • If you specify alternate text, it only affects how the link appears, not where the link actually goes.

Examples of Usage

Current Page Template Syntax Link Location Link Text (Default) Path Type
Mirror's Edge {{Link|Faith Connors}} Mirror's Edge/Faith Connors Faith Connors Relative
Mirror's Edge/Stash Points {{Link|Mercury}} Mirror's Edge/Mercury Mercury Relative
Mirror's Edge {{Link|/}} Mirror's Edge Mirror's Edge Relative
Mirror's Edge/Kate Connors {{Link|/}} Mirror's Edge Mirror's Edge Relative
Doesn't matter {{Link|/Main Page}} Main Page Main Page Absolute
Doesn't matter {{Link|/Mirror's Edge/Melee Combat}} Mirror's Edge/Melee Combat Mirror's Edge/Melee Combat Absolute

Uncompressed Code

{{#if: {{{1|}}} |
  {{#ifeq: {{#pos: {{{1}}} | /}} | 0 |
    {{#ifeq: {{{1}}} | / |
      {{#switch: {{PageType}}
      | Sub Page
      | Sub Image
      | Base Page = [[{{HubName}}|{{{2|{{HubName}}}}}]]
      | Base Image = [[Main Page|{{{2|Main Page}}}]]
      }} |
      [[{{#sub: {{{1}}} | 1}}|{{{2|{{#sub: {{{1}}} | 1}}}}}]]
    }} |
    {{#switch: {{PageType}}
    | Sub Page
    | Sub Image
    | Base Page = [[{{HubName}}/{{{1}}}|{{{2|{{{1}}}}}}]]
    | Base Image = [[{{{1}}}|{{{2|{{{1}}}}}}]]
    }}
  }}
}}