Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Icon/data/doc
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!
{{Module rating|protected}} {{High-use|demo=Module:{{ROOTPAGENAME}}}} This module stores icon data for [[Module:Icon]]. == Adding icons == To add a new icon, add a table in the following format: <syntaxhighlight lang="lua"> code = { image = "My image name.xyz", tooltip = "My tooltip text", link = true, }, </syntaxhighlight> The code should be in lower case. === Fields === * <code>image</code>: the image to be displayed. This should be without the <code>File:</code> prefix. So, if you wanted to add [[:File:Featured article star.svg]], you would use {{code|"Featured article star.svg"|lua}} here. If any of the text you add has double quotes in, you will need to escape it with backslashes like this: {{code|"My \"quoted\" image.svg"|lua}}. * <code>tooltip</code>: the tooltip to be displayed when hovering the mouse above the image. This is optional, although it is recommended you include it. * <code>link</code>: if false, the link to the file description page is suppressed. You should only set this to false if the icon image is in the public domain, or is released under a license that does not require attribution (such as [[CC-0]]). For images released under licenses that require attribution such as [[CC-BY-SA]] and the [[GFDL]], you should set this to true to preserve the link to the file description page. === Aliases === If you want to add aliases for the code, add an <code>aliases</code> table as follows: <syntaxhighlight lang="lua"> code = { aliases = {"alias1", "alias2"}, image = "My image name.xyz", tooltip = "My tooltip text", link = true, }, </syntaxhighlight> Please make sure that any codes and aliases that you add don't match any existing codes or aliases. If they do, one of them will be overwritten with the other (and it's not possible to say for certain which will be overwritten with which). == Removing icons == Removing icons is fairly easy. Just remove the relevant entry from the data table. You should not remove the _DEFAULT entry, as [[Module:Icon]] relies on it being there, and removing it will cause script errors. <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Code
(
edit
)
Template:High-use
(
edit
)
Template:Module rating
(
edit
)