Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Discord server
Recent changes
Random page
Community
Discord
Steam
Search
Search
English
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:PageRef/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Languages
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Overview= Outputs an icon in svg and a link to the given localized page with an optional alternate display name. Output will be:<br> <icon> <pagename> * 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. ** 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 ** 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= In its simplest form: <code><nowiki>{{PageRef|Lash}}</nowiki></code> {{PageRef|Lash}} Example where the icon doesn't exist: <code><nowiki>{{PageRef|Shopkeeper}}</nowiki></code> {{PageRef|Shopkeeper}} Using alt_name: <code><nowiki>{{PageRef|Lash|alt_name=Jacob}}</nowiki></code> {{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. If a file does not exist, it will look like {{PageRef|My cool page}} To not use the file, use: <code><nowiki>{{PageRef|My cool page|no_file=true}}</nowiki></code> {{PageRef|My cool page|no_file=true}} =Parameters= <templatedata> { "params": { "name": { "label": "Name", "description": "The localized name of the page to link to, also used to determine the icon.", "required": true, "example": "Lash", "aliases": [ "1" ], "type": "string" }, "no_file": { "label": "Do not use file", "description": "Do not use any file; also use this parameter when a file doesn't exist. Note that passing 'false' does not make it use a file, the parameter must then be omitted. This is for code efficiency", "required": false, "example": "true", "type": "string" }, "alt_name": { "label": "Alternate Name", "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", "required": false, "example": "Death Slam" }, "alt_file_name": { "label": "Alternate File Name", "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", "required": false, "example": "Amber Hand.png" }, "size": { "label": "Size", "description": "Size of the icon link, defaulted to '15'px", "type": "number", "required": false, "example": "50" } }, "format": "inline" } </templatedata>
Summary:
Please note that all contributions to Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Template:PageRef
(
edit
)
Module:PageRef
(
edit
)
This page is a member of a hidden category:
Category:Pages with broken file links