Jump to content

Template:MaterialInfobox: Difference between revisions

From Elite Dangerous Wiki
Content deleted Content added
No edit summary
Restoring old version, the portable infobox format broke the Known Uses list
Line 1: Line 1:
<onlyinclude>{{#infoboxbuilder:
<infobox theme="portInfobox">
| 0:Theme = eInfobox | 0:CustomModule = Module:Infobox Material
<title source="grade"><format>{{#switch: {{{grade|}}}
| 1:Type = Title
⚫
| Very rare | Very Rare | very rare = [[File:Very_Rare_material.svg|35px|link=]][[Category:Very rare materials]]
| 1:Label = NULL
⚫
| Rare | rare = [[File:Rare_material.svg|35px|link=]][[Category:Rare materials]]
| 1:ValueMethod = PreTitleIcon
⚫
| Common | common = [[File:Common material.svg|35px|link=]][[Category:Common materials]]
| 1:Grade = {{{grade|}}}
⚫
| Very common | Very Common | very common = [[File:Very common material.svg|35px|link=]][[Category:Very common materials]]
| 1:Value = {{PAGENAME}}
⚫
| Standard | standard = [[File:Standard_material.svg|35px|link=]][[Category:Standard materials]]
| 2:Type = MainImage
}} {{PAGENAME}}</format></title>
| 2:Label = NULL
<image source="image"/>
| 2:Value = {{#if:{{{image|}}}|[[File:{{{image|}}}|306px]]}}
<data source="grade">
| 3:Type = Line
<label>Grade</label>
| 3:Label = Grade
</data>
| 3:Value = {{{grade|}}}
<group layout="horizontal">
| 4:Type = Custom
<header>Known Uses</header>
| 4:Label = tr
<data source="knownuses">
| 4:Value = <td colspan="2">Known uses</td>
<!-- <format></format>
| 4:CssClass = custom-listheader
TODO: Write a Lua function with Dev:List
| 5:Type = Custom
L.makeList('unbulleted', mw.text.split(args.knownuses, ';'))
| 5:Label =
-->
| 5:Value = {{{knownuses|}}}
</data>
| 5:ValueMethod = TableSplitRows
</group>
| 5:CssClass = custom-list
</infobox>
}}
<includeonly>[[Category:Materials]]</includeonly>
<includeonly>[[Category:Materials]]
{{#switch:{{lc:{{{grade|}}}}}
| common
⚫
| Common = [[Category:Common materials]]
| rare
⚫
| Rare = [[Category:Rare materials]]
| standard
⚫
| Standard = [[Category:Standard materials]]
| very common
| Very Common
⚫
| Very common = [[Category:Very common materials]]
| very rare
| Very Rare
⚫
| Very rare = [[Category:Very rare materials]]
}}
</includeonly>
</onlyinclude>
<noinclude>
<noinclude>
<pre style="width: 300px">
<pre style="width: 300px">
{{MaterialInfobox
{{MaterialInfobox
| image =
| image =
| grade =
| grade =
| knownuses =
| knownuses =
}}
}}
</pre>
</pre>

Revision as of 00:34, 27 October 2019

{{#infoboxbuilder: | 0:Theme = eInfobox | 0:CustomModule = Module:Infobox Material | 1:Type = Title

| 1:Label = NULL
| 1:ValueMethod = PreTitleIcon
| 1:Grade = 
| 1:Value = MaterialInfobox

| 2:Type = MainImage

| 2:Label = NULL
| 2:Value = 

| 3:Type = Line

| 3:Label = Grade
| 3:Value = 

| 4:Type = Custom

| 4:Label = tr

| 4:Value = Known uses

| 4:CssClass = custom-listheader

| 5:Type = Custom

| 5:Label =
| 5:Value = 
| 5:ValueMethod = TableSplitRows
| 5:CssClass = custom-list

}}


{{MaterialInfobox
| image     = 
| grade     = 
| knownuses = 
}}

Usage

grade
The grade or rating on how difficult it is to find. Can either be "Very common", "Common", "Standard", "Rare", or "Very rare".
image
The image to display in the material infobox.
knownuses
The known uses listed in the information of the material. New material are separated by semi-colon (";"). Names have to be exact in terms of both name and capitalisation. Please use icon templates such as {{Material ship}}.