Template:MaterialInfobox: Difference between revisions

Content deleted Content added
No edit summary
Restoring old version, the portable infobox format broke the Known Uses list
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>
{{#switch:{{lc:{{{grade|}}}}}
| common
▲ | Common | common = [[File:Common material.svg|35px|link=]][[Category:Common materials]]
| rare
▲ | Rare | rare = [[File:Rare_material.svg|35px|link=]][[Category:Rare materials]]
| standard
▲ | Standard | standard = [[File:Standard_material.svg|35px|link=]][[Category:Standard materials]]
| very common
| Very Common
▲ | Very common | Very Common | very common = [[File:Very common material.svg|35px|link=]][[Category:Very common materials]]
| very rare
| Very Rare
▲ | Very rare | Very Rare | very rare = [[File:Very_Rare_material.svg|35px|link=]][[Category:Very rare materials]]
}}
</includeonly>
</onlyinclude>
<noinclude>
<pre style="width: 300px">
{{MaterialInfobox
| image =
| grade =
| knownuses =
}}
</pre>