Editing Template:PageRef/docGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
=Overview= | =Overview= | ||
Outputs an icon in svg and a link to the given localized 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. | ||
| Line 10: | Line 9: | ||
** The .svg should be both light and dark theme compatible (WIP) | ** The .svg should be both light and dark theme compatible (WIP) | ||
***It's possible CSS may be used to automatically invert colors, precluding the need for the icon to be 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 at least be default theme compatible ( | ** The .png should at least be default theme compatible (light) | ||
** If neither the .svg nor the .png exist, the icon will not be added | ** If neither the .svg nor the .png exist, the icon will not be added | ||
* If the first parameter (name) is a hero name in english, it will automatically use the <hero>_MM.png file | * If the first parameter (name) is a hero name in english, it will automatically use the <hero>_MM.png file | ||
** Otherwise, if the file name is different to the page name (do not use this in excess), the <i>alt_file_name</i> parameter will need to be used | ** Otherwise, if the file name is different to the page name (do not use this in excess), the <i>alt_file_name</i> parameter will need to be used | ||
=Examples= | =Examples= | ||
In its simplest form: <code><nowiki>{{PageRef|Lash}}</nowiki></code> {{PageRef|Lash}} | In its simplest form: <code><nowiki>{{PageRef|Lash}}</nowiki></code> {{PageRef|Lash}} | ||
Example where the icon doesn't exist: <code><nowiki>{{PageRef| | Example where the icon doesn't exist: <code><nowiki>{{PageRef|Amber Hand}}</nowiki></code> {{PageRef|Amber Hand}} | ||
Using alt_name: <code><nowiki>{{PageRef|Lash|alt_name=Jacob}}</nowiki></code> {{PageRef|Lash|alt_name=Jacob}} | Using alt_name: <code><nowiki>{{PageRef|Lash|alt_name=Jacob}}</nowiki></code> {{PageRef|Lash|alt_name=Jacob}} | ||
| Line 34: | Line 32: | ||
Note: Instead of repeated use of <i>alt_file_name</i>, it is recommended to create a redirect at <nowiki>[[<first_parameter>.png]]</nowiki> to <nowiki>[[<alt_file_name>.png]]</nowiki>, allowing the use of the simplest form of PageRef, making it much easier to reference in the future. | Note: Instead of repeated use of <i>alt_file_name</i>, it is recommended to create a redirect at <nowiki>[[<first_parameter>.png]]</nowiki> to <nowiki>[[<alt_file_name>.png]]</nowiki>, allowing the use of the simplest form of PageRef, making it much easier to reference in the future. | ||
=Parameters= | |||
<templatedata> | <templatedata> | ||
{ | { | ||
| Line 56: | Line 44: | ||
"aliases": [ | "aliases": [ | ||
"1" | "1" | ||
] | ] | ||
}, | }, | ||
"alt_name": { | "alt_name": { | ||
| Line 89: | Line 69: | ||
"size": { | "size": { | ||
"label": "Size", | "label": "Size", | ||
"description": "Size of the icon link, defaulted to ' | "description": "Size of the icon link, defaulted to '15'px", | ||
"type": "number", | "type": "number", | ||
"required": false, | "required": false, | ||
"example": "50" | "example": "50" | ||
} | } | ||
}, | }, | ||