More actions
m alt_file_name added |
m old guide info removed; docs now much more readable; all new examples written including for new param alt_file_name |
||
Line 2: | Line 2: | ||
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. | ||
Output | Output will be:<br> | ||
<icon> <pagename> | <icon> <pagename> | ||
* Both icon and page name | * Both icon and page name will be hyperlinked to first parameter as the pagename | ||
* 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 (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 be default theme compatible (light) | ** 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 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 | |||
=Examples= | =Examples= | ||
In its simplest form: <code><nowiki>{{PageRef|Lash}}</nowiki></code> {{PageRef|Lash}} | |||
{{PageRef|Lash|alt_name=Jacob}} | Using alt_name: <code><nowiki>{{PageRef|Lash|alt_name=Jacob}}</nowiki></code> {{PageRef|Lash|alt_name=Jacob}} | ||
{{PageRef|Lash|alt_name=Jacob}} | |||
Using alt_link (hover the link to see): <code><nowiki>{{PageRef|Lash|alt_link=Cold Front}}</nowiki></code> {{PageRef|Lash|alt_link=Cold Front}} | |||
< | Using alt_file_name: <code><nowiki>{{PageRef|Lash|alt_file_name=Cold Front}}</nowiki></code> {{PageRef|Lash|alt_file_name=Cold Front}} | ||
Using them all together, note that the first parameter is no longer used and therefore not needed: | |||
< | <code><nowiki>{{PageRef|alt_name=Cold Front|alt_link=Cold Front|alt_file_name=Cold Front}}</nowiki></code> | ||
{{PageRef|alt_name=Cold Front|alt_link=Cold Front|alt_file_name=Cold Front}} | |||
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 67: | Line 58: | ||
"alt_file_name": { | "alt_file_name": { | ||
"label": "Alternate File Name", | "label": "Alternate File Name", | ||
"description": "An optional way to designate which file to include. Not needed if <first parameter> | "description": "An optional way to designate which file to include. Not needed if <first parameter> (name) is the same as the file name. File extension not needed, as it will try to prioritize the .svg first, otherwise use the .png.", | ||
"type": "string", | "type": "string", | ||
"required": false, | "required": false, |