Template:PageRef/doc: Difference between revisions

From Deadlock Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 11: Line 11:


=Examples=
=Examples=
{{PageRef|target=Lash|type=Hero|altname=Jacob}}
{{PageRef|target=Bullet Lifesteal|type=Item|alttarget=Bullet Lifesteal (item)}}
(not yet working)
(not yet working)
{{PageRef|target=Lash|type=Hero|altname=Jacob}}


{{PageRef|Lash|alt=Jacob}}
{{PageRef|Lash|alt=Jacob}}

Revision as of 15:10, 17 October 2024

Overview

Outputs an icon in svg and a link to the given 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
  • The .png should be default theme compatible (light)

Examples

[[Lua error in Module:PageRef at line 41: attempt to index a nil value.|link={{{1}}}|25px]] [[{{{1}}}|{{{1}}}]] [[Lua error in Module:PageRef at line 41: attempt to index a nil value.|link={{{1}}}|25px]] [[{{{1}}}|{{{1}}}]]

(not yet working)

Lash

50 Siphon Life

AttributeIconTechDuration

Basic Magazine

100 The Curiosity Shop


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

{{PageRef|Lash|alt=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

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Namename

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

Example
Lash
Stringrequired
Alternate Namealt

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

Example
Jacob
Stringoptional
Sizesize

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

Example
50
Numberoptional