Template:PageRef

From Deadlock Wiki
Revision as of 19:09, 20 October 2024 by Sur (talk | contribs) (includeonly and noinclude instead of onlyinclude so its not calling itself on here and showing errors)
Jump to navigation Jump to search
Template documentation [view] [edit] [history] [purge]

Overview

Outputs an icon in svg and a link to the given localized page with an optional alternate display name.

Output should be:
<icon> <pagename>

  • Both icon and page name should be hyperlinked to first parameter as the pagename
  • Icon should be
    [[File:<pagename>.svg]]
    if the svg file exists, otherwise the .png.
  • The .svg should be both light and dark theme compatible
    • It's possible CSS may be used to automatically invert colors, precluding the need for the icon to be theme-compatible
  • The .png should be default theme compatible (light)

Examples

[[Script error: The function "getFilename" does not exist.|link=Lash|25px]] Lash [[Script error: The function "getFilename" does not exist.|link=Bullet Lifesteal|25px]] Bullet Lifesteal [[Script error: The function "getFilename" does not exist.|link=Siphon Life|25px]] Siphon Life

not yet working

[[Script error: The function "getFilename" does not exist.|link=Lash|25px]] Lash

[[Script error: The function "getFilename" does not exist.|link=Siphon Life|50]] Siphon Life

[[Script error: The function "getFilename" does not exist.|link=AttributeIconTechDuration|25px]] AttributeIconTechDuration

[[Script error: The function "getFilename" does not exist.|link=Basic Magazine|25px]] Basic Magazine

[[Script error: The function "getFilename" does not exist.|link=The Curiosity Shop|100]] The Curiosity Shop


Below is a fake example. Ideally, the template is called like:

{{PageRef|Lash|alt_name=Jacob}}

In wikitext it would look be outputted as:

[[File:Lash.svg|class=dark_or_light|link=Lash|size=15]] [[Lash|Jacob]]

Which would appear in visual as

Jacob

No description.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Namename

The localized name of the page to link to, also used to determine the icon.

Example
Lash
Stringrequired
Alternate Namealt_name

An optional display name to show instead of the page name in the link.

Example
Jacob
Stringoptional
Alternate Linkalt_link

An optional link to link to instead of the 1st parameter (name).

Example
Death Slam
Stringoptional
Sizesize

Size of the icon link, defaulted to '15'px

Example
50
Numberoptional