Template:PageRef/doc: Difference between revisions

From Deadlock Wiki
Jump to navigation Jump to search
mNo edit summary
Sur (talk | contribs)
m name should be localized
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Overview=
=Overview=
Outputs an icon in svg and a link to the given page with an optional alternate display name.
Outputs an icon in svg and a link to the given localized page with an optional alternate display name.


Output should be:<br>
Output should be:<br>
Line 8: Line 8:
* Icon should be <pre style="width: fit-content>[[File:<pagename>.svg]]</pre> if the svg file exists, otherwise the .png.  
* Icon should be <pre style="width: fit-content>[[File:<pagename>.svg]]</pre> if the svg file exists, otherwise the .png.  
* The .svg should be both light and dark theme compatible
* 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)
* The .png should be default theme compatible (light)


=Examples=
=Examples=
(not yet working)
{{PageRef|target=Lash|type=Hero|altname=Jacob}}


{{PageRef|Lash|alt=Jacob}}
{{PageRef|Lash|alt_name=Jacob}}
{{PageRef|Bullet Lifesteal|alt_link=Bullet Lifesteal (item)}}
{{PageRef|Siphon Life|alt_link=Abrams#(1) Siphon Life}}
 
==not yet working==
 
{{PageRef|Lash|alt_name=Jacob}}


{{PageRef|Siphon Life|size=50}}
{{PageRef|Siphon Life|size=50}}
Line 22: Line 27:
{{PageRef|Basic Magazine}}
{{PageRef|Basic Magazine}}


{{PageRef|The Curiosity Shop|alt=Shop|size=100}}
{{PageRef|The Curiosity Shop|alt_name=Shop|size=100}}




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


<pre style="width: fit-content">{{PageRef|Lash|alt=Jacob}}</pre>
<pre style="width: fit-content">{{PageRef|Lash|alt_name=Jacob}}</pre>


In wikitext it would look be outputted as:
In wikitext it would look be outputted as:
Line 41: Line 46:
         "name": {
         "name": {
             "label": "Name",
             "label": "Name",
             "description": "The name of the page to link to, also used to determine the icon.",
             "description": "The localized name of the page to link to, also used to determine the icon.",
             "type": "string",
             "type": "string",
             "required": true,
             "required": true,
             "example": "Lash"
             "example": "Lash"
         },
         },
         "alt": {
         "alt_name": {
             "label": "Alternate Name",
             "label": "Alternate Name",
             "description": "An optional display name to show instead of the page name in the link.",
             "description": "An optional display name to show instead of the page name in the link.",
Line 52: Line 57:
             "required": false,
             "required": false,
             "example": "Jacob"
             "example": "Jacob"
        },
        "alt_link": {
            "label": "Alternate Link",
            "description": "An optional link to link to instead of the 1st parameter (name).",
            "type": "string",
            "required": false,
            "example": "Death Slam"
         },
         },
         "size": {
         "size": {

Latest revision as of 19:57, 20 October 2024

Overview[edit source]

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[edit source]

Jacob Bullet Lifesteal Siphon Life

not yet working[edit source]

Jacob

50 Siphon Life

AttributeIconTechDuration

Basic Magazine

100 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

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