Template:Icon/doc: Difference between revisions

From Space Exploration
Jump to navigation Jump to search
imported>Ahopefulhobbit
trying to get infoboxes working
 
imported>Ahopefulhobbit
fixed to show icons that actually exist
Line 8: Line 8:


Putting two pipes after the first parameter will produce an icon that links to nothing and shows no number (useful if you don't want to link to a page that doesn't exist):
Putting two pipes after the first parameter will produce an icon that links to nothing and shows no number (useful if you don't want to link to a page that doesn't exist):
<nowiki>{{icon|dead-tree||}}</nowiki> → {{icon|dead-tree||}}
<nowiki>{{icon|genetic||}}</nowiki> → {{icon|genetic||}}


Some usage examples:
Some usage examples:


* <nowiki>{{icon|Intentionally missing image|color=ff00ff}}</nowiki> → {{icon|Intentionally missing image|color=ff00ff}}
* <nowiki>{{icon|Intentionally missing image|color=ff00ff}}</nowiki> → {{icon|Intentionally missing image|color=ff00ff}}
* <nowiki>{{icon|Tree|color=0000ff}}</nowiki> → {{icon|Tree|color=0000ff}}
* <nowiki>{{icon|genetic|color=0000ff}}</nowiki> → {{icon|genetic|color=0000ff}}
* <nowiki>{{icon|Iron plate||Copper plate}}</nowiki> → {{icon|Iron plate||Copper plate}}
* <nowiki>{{icon|genetic||Data Card}}</nowiki> → {{icon|genetic||Data Card}}
* <nowiki>{{icon|Iron plate|text}}</nowiki> → {{icon|Iron plate|text}}
* <nowiki>{{icon|genetic|text}}</nowiki> → {{icon|genetic|text}}
* <nowiki>{{icon|automobilism (research)|icon-text-class=navbox-icon-text|some text}}</nowiki> → {{icon|automobilism (research)|icon-text-class=navbox-icon-text|some text}}
* <nowiki>{{icon|genetic|icon-text-class=navbox-icon-text|some text}}</nowiki> → {{icon|genetic|icon-text-class=navbox-icon-text|some text}}

Revision as of 23:00, 15 November 2021

{{icon|File name|text|Page name|color=hex color code|icon-text-class=html/css class}}

  • First parameter: The name of the icon file. Usually the in-game name of the item, e.g. "Raw fish". The file name is converted using Template:ConvertName, which for example resolves the input of "Battery MK1" to battery-equipment. (Required)
  • Second parameter: Text to display on top of the icon. (Optional)
  • Third parameter: The name of the page the icon links to. If this parameter is completely empty, the first parameter will be used instead of this one. The template adds the language suffix (of the language the page is on) to the link e.g. Wood links to Wood/de on a German page. (Optional)
  • Color parameter: A hex color code without the #. Determines the background color of the icon e.g. ffffff for white. (Optional, default: 929292)
  • Icon text class parameter: A html class associated with some css code. Determines how the number is displayed on the icon. Currently unused. (Optional, default: factorio-icon-text)

Putting two pipes after the first parameter will produce an icon that links to nothing and shows no number (useful if you don't want to link to a page that doesn't exist):

{{icon|genetic||}} →

Some usage examples: