Template:PageRef/doc: Difference between revisions
Jump to navigation
Jump to search
m type param removed |
m alttarget -> alt_link, altname -> alt_name |
||
Line 13: | Line 13: | ||
=Examples= | =Examples= | ||
{{PageRef|Lash| | {{PageRef|Lash|alt_name=Jacob}} | ||
{{PageRef|Bullet Lifesteal| | {{PageRef|Bullet Lifesteal|alt_link=Bullet Lifesteal (item)}} | ||
{{PageRef|Siphon Life| | {{PageRef|Siphon Life|alt_link=Abrams#(1) Siphon Life}} | ||
==not yet working== | ==not yet working== | ||
{{PageRef|Lash| | {{PageRef|Lash|alt_name=Jacob}} | ||
{{PageRef|Siphon Life|size=50}} | {{PageRef|Siphon Life|size=50}} | ||
Line 27: | Line 27: | ||
{{PageRef|Basic Magazine}} | {{PageRef|Basic Magazine}} | ||
{{PageRef|The Curiosity Shop| | {{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| | <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 51: | Line 51: | ||
"example": "Lash" | "example": "Lash" | ||
}, | }, | ||
" | "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.", | ||
"type": "string", | |||
"required": false, | |||
"example": "Jacob" | |||
}, | |||
"alt_link": { | |||
"label": "Alternate Link", | |||
"description": "An optional link to link to instead of the 1st parameter (name).", | |||
"type": "string", | "type": "string", | ||
"required": false, | "required": false, |
Revision as of 19:35, 20 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
- 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
Jacob Bullet Lifesteal Siphon Life
not yet working
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
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Name | name | The name of the page to link to, also used to determine the icon.
| String | required |
Alternate Name | alt_name | An optional display name to show instead of the page name in the link.
| String | optional |
Alternate Link | alt_link | An optional link to link to instead of the 1st parameter (name).
| String | optional |
Size | size | Size of the icon link, defaulted to '15'px
| Number | optional |