Raft Wiki
mNo edit summary
mNo edit summary
 
(105 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<!--
 
<!--
  +
*********************************************************************************************************************
+
***********************************************************************************************************************
This code implements infobox! It is designed to work perfectly with Wiki-Bot, while correctly showing on Wiki pages.
+
This code implements an infobox! It is designed to work perfectly with Wiki-Bot, while correctly showing on Wiki pages.
Please, don't make changes, unless you are sure what are you doing, as your edits may destroy entire system.
+
Please, don't make big changes, unless you are sure what are you doing, as your edits may break the entire infobox. Use
*********************************************************************************************************************
 
  +
[[Template:Infobox/Draft]] instead.
-->{| class="infoboxtable" style="width:350px" style="margin-left:10px;"
 
 
***********************************************************************************************************************
! class="header" colspan="2" style="border-bottom: 4px solid #baa16a; text-transform: uppercase; text-align: center; color: #a48754;" |
 
  +
{| style="width:100%;"
 
  +
-->{| class="infobox"
! width=50 {{#if:{{{image|}}}||style="display:none"}} | {{#if: {{{image|}}} | <div class="infoboximage">[[File:{{{image}}}|50px|center]]</div> }}
 
  +
{{#if: {{{imageLeftTop|}}}| ! class="infobox-header nomobile" {{!}} [[File:{{{imageLeftTop|}}}|50px|Click here to see information about this file]]}}
| <span style="font-size: 140%">'''{{{name|{{PAGENAME}}}}}'''</span>
 
  +
|}
 
 
! class="header" {{#if: {{{imageLeftTop|}}}||colspan="2"}}| <span style="font-size: 135%">'''{{{name|{{PAGENAME}}}}}'''</span>
 
|-
 
|-
  +
! class="headerSeperator nomobile" colspan="2"|
|colspan="2"| {{#if: {{{banner|}}}| [[File:{{{banner}}}|300px]]}}
 
 
|-
 
|colspan="4" class="nomobile"| {{#if: {{{image|}}}| <div class="InfoboxImage">[[File:{{{image|}}}|300px|center|Click here to see information about this file]]</div>}}
  +
| colspan="4" class="mobileonly | {{#if: {{{image|{{{imageLeftTop|}}}}}} | [[File:{{{image|{{{imageLeftTop|}}}}}}|center]] }}
 
|- valign="top"
 
|- valign="top"
 
{{#if: {{{desc|}}} | {{!}} colspan="2" {{!}} <center>'''{{{desc}}}'''</center> }}
 
{{#if: {{{desc|}}} | {{!}} colspan="2" {{!}} <center>'''{{{desc}}}'''</center> }}
 
|-
 
|-
  +
<!--
{{#if: {{{component1name|}}} | {{!}} colspan="2" style="text-transform: uppercase; text-align: left;" {{!}} '''{{{componentTitle|Requires}}}''' }}
 
  +
|-
 
  +
**********************
{{#if: {{{component1name|}}} | {{!}} width=50 {{!}} <div class="componentsimage">[[File:{{#titleparts:{{{component1name}}}|1}}.png|center|48px]]</div> {{!!}} style="padding:0;" {{!}} <div style="font-size:120%;" class="components">'''[[{{{component1name}}}|{{{component1transl|{{{component1name}}}}}}]]''' <span style="float: right; padding-right: 15px;">'''{{{component1amount|}}}'''</span></div> }}
 
  +
ComponentsTabs system
|-
 
  +
**********************
{{#if: {{{component2name|}}} | {{!}} width=50 {{!}} <div class="componentsimage">[[File:{{#titleparts:{{{component2name}}}|1}}.png|center|48px]]</div> {{!!}} <div style="font-size:120%;" class="components">'''[[{{{component2name|}}}]]''' <span style="float: right; padding-right: 15px;">'''{{{component2amount|}}}'''</span></div> }}
 
  +
|-
 
  +
------ WARNING ------
{{#if: {{{component3name|}}} | {{!}} width=50 {{!}} <div class="componentsimage">[[File:{{#titleparts:{{{component3name}}}|1}}.png|center|48px]]</div> {{!!}} <div style="font-size:120%;" class="components">'''[[{{{component3name|}}}]]''' <span style="float: right; padding-right: 15px;">'''{{{component3amount|}}}'''</span></div> }}
 
  +
This system will work correctly "only" on English articles. Workaround for languages is available for 1-tab infoboxes
  +
  +
--- DOCUMENTATION ---
  +
This system allows more items to be documented in an infobox
  +
  +
-->
  +
| {{#if: {{{item1component1|}}}|'''{{{ctt|Requires:}}}'''}}
 
|-
 
|-
  +
| colspan="2" class="componentTabsWrapper"| {{#if: {{{item1component1|}}}| <!-- componentsTabsWrapper is used as a place for CT injection -->
{{#if: {{{component4name|}}} | {{!}} width=50 {{!}} <div class="componentsimage">[[File:{{#titleparts:{{{component4name}}}|1}}.png|center|48px]]</div> {{!!}} <div style="font-size:120%;" class="components">'''[[{{{component4name|}}}]]''' <span style="float: right; padding-right: 15px;">'''{{{component4amount|}}}'''</span></div> }}
 
  +
  +
{{Infobox/componentsTabs
  +
|{{#if: {{{item1component1|}}}|{{{name|}}},<!--
  +
  +
-->{{#if: {{{item1component1|}}}| <table><tr><td>{{Infobox/components|{{{item1component1|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item1component2|}}}| <tr><td>{{Infobox/components|{{{item1component2|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item1component3|}}}| <tr><td>{{Infobox/components|{{{item1component3|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item1component4|}}}| <tr><td>{{Infobox/components|{{{item1component4|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item1component5|}}}| <tr><td>{{Infobox/components|{{{item1component5|}}}}}</td></tr>}} </table>}}<!--
  +
  +
-->|{{#if: {{{item2component1|}}}|{{{name2|}}},<!--
  +
  +
-->{{#if: {{{item2component1|}}}| <table><tr><td>{{Infobox/components|{{{item2component1|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item2component2|}}}| <tr><td>{{Infobox/components|{{{item2component2|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item2component3|}}}| <tr><td>{{Infobox/components|{{{item2component3|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item2component4|}}}| <tr><td>{{Infobox/components|{{{item2component4|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item2component5|}}}| <tr><td>{{Infobox/components|{{{item2component5|}}}}}</td></tr>}} </table>}}<!--
  +
  +
-->|{{#if: {{{item3component1|}}}|{{{name3|}}},<!--
  +
  +
-->{{#if: {{{item3component1|}}}| <table><tr><td>{{Infobox/components|{{{item3component1|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item3component2|}}}| <tr><td>{{Infobox/components|{{{item3component2|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item3component3|}}}| <tr><td>{{Infobox/components|{{{item3component3|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item3component4|}}}| <tr><td>{{Infobox/components|{{{item3component4|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item3component5|}}}| <tr><td>{{Infobox/components|{{{item3component5|}}}}}</td></tr>}} </table>}}<!--
  +
  +
-->|{{#if: {{{item4component1|}}}|{{{name4|}}},<!--
  +
  +
-->{{#if: {{{item4component1|}}}| <table><tr><td>{{Infobox/components|{{{item4component1|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item4component2|}}}| <tr><td>{{Infobox/components|{{{item4component2|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item4component3|}}}| <tr><td>{{Infobox/components|{{{item4component3|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item4component4|}}}| <tr><td>{{Infobox/components|{{{item4component4|}}}}}</td></tr>}} <!--
  +
  +
-->{{#if: {{{item4component5|}}}| <tr><td>{{Infobox/components|{{{item4component5|}}}}}</td></tr>}} </table>}}}}<!--
  +
  +
This ends the ComponentsTabs
  +
  +
-->}}
 
|-
 
|-
  +
{{#if: {{{product|}}}|{{!}}'''Product''':}}
{{#if: {{{component5name|}}} | {{!}} width=50 {{!}} <div class="componentsimage">[[File:{{#titleparts:{{{component5name}}}|1}}.png|center|48px]]</div> {{!!}} <div style="font-size:120%;" class="components">'''[[{{{component5name|}}}]]''' <span style="float: right; padding-right: 15px;">'''{{{component5amount|}}}'''</span></div> }}
 
 
|-
 
|-
  +
<!-- Final product -->
{{#if: {{{descHeader|}}} | {{!}} colspan="2" style="text-transform: uppercase; text-align: left;" {{!}} {{{descHeader|}}} }}
 
  +
{{#if: {{{product|}}}|
  +
{{!}} class="componentsimage" {{!}}
  +
[[File:{{{product|}}}.png|48px|center]]
  +
{{!}} class="components" {{!}}
  +
'''[[{{{product|}}}]]'''<span style="float: right; padding: 0 15px 0 9px">'''{{{productAmount|1}}}'''</span></div>
  +
}}
  +
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data1|}}} | {{!}} width=80 {{!}} <div>'''{{{title1}}}'''</div> {{!!}} {{{data1}}} }}
+
{{#if: {{{data1|}}} | {{!}} width=80 {{!}} <div>'''{{{title1}}}'''</div> {{!!}} {{{data1}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data2|}}} | {{!}} width=80 {{!}} <div>'''{{{title2}}}'''</div> {{!!}} {{{data2}}} }}
+
{{#if: {{{data2|}}} | {{!}} width=80 {{!}} <div>'''{{{title2}}}'''</div> {{!!}} {{{data2}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data3|}}} | {{!}} width=80 {{!}} <div>'''{{{title3}}}'''</div> {{!!}} {{{data3}}} }}
+
{{#if: {{{data3|}}} | {{!}} width=80 {{!}} <div>'''{{{title3}}}'''</div> {{!!}} {{{data3}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data4|}}} | {{!}} width=80 {{!}} <div>'''{{{title4}}}'''</div> {{!!}} {{{data4}}} }}
+
{{#if: {{{data4|}}} | {{!}} width=80 {{!}} <div>'''{{{title4}}}'''</div> {{!!}} {{{data4}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data5|}}} | {{!}} width=80 {{!}} <div>'''{{{title5}}}'''</div> {{!!}} {{{data5}}} }}
+
{{#if: {{{data5|}}} | {{!}} width=80 {{!}} <div>'''{{{title5}}}'''</div> {{!!}} {{{data5}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data6|}}} | {{!}} width=80 {{!}} <div>'''{{{title6}}}'''</div> {{!!}} {{{data6}}} }}
+
{{#if: {{{data6|}}} | {{!}} width=80 {{!}} <div>'''{{{title6}}}'''</div> {{!!}} {{{data6}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data7|}}} | {{!}} width=80 {{!}} <div>'''{{{title7}}}'''</div> {{!!}} {{{data7}}} }}
+
{{#if: {{{data7|}}} | {{!}} width=80 {{!}} <div>'''{{{title7}}}'''</div> {{!!}} {{{data7}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data8|}}} | {{!}} width=80 {{!}} <div>'''{{{title8}}}'''</div> {{!!}} {{{data8}}} }}
+
{{#if: {{{data8|}}} | {{!}} width=80 {{!}} <div>'''{{{title8}}}'''</div> {{!!}} {{{data8}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data9|}}} | {{!}} width=80 {{!}} <div>'''{{{title9}}}'''</div> {{!!}} {{{data9}}} }}
+
{{#if: {{{data9|}}} | {{!}} width=80 {{!}} <div>'''{{{title9}}}'''</div> {{!!}} {{{data9}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data10|}}} | {{!}} width=80 {{!}} <div>'''{{{title10}}}'''</div> {{!!}} {{{data10}}} }}
+
{{#if: {{{data10|}}} | {{!}} width=80 {{!}} <div>'''{{{title10}}}'''</div> {{!!}} {{{data10}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data11|}}} | {{!}} width=80 {{!}} <div>'''{{{title11}}}'''</div> {{!!}} {{{data11}}} }}
+
{{#if: {{{data11|}}} | {{!}} width=80 {{!}} <div>'''{{{title11}}}'''</div> {{!!}} {{{data11}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data12|}}} | {{!}} width=80 {{!}} <div>'''{{{title12}}}'''</div> {{!!}} {{{data12}}} }}
+
{{#if: {{{data12|}}} | {{!}} width=80 {{!}} <div>'''{{{title12}}}'''</div> {{!!}} {{{data12}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data13|}}} | {{!}} width=80 {{!}} <div>'''{{{title13}}}'''</div> {{!!}} {{{data13}}} }}
+
{{#if: {{{data13|}}} | {{!}} width=80 {{!}} <div>'''{{{title13}}}'''</div> {{!!}} {{{data13}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data14|}}} | {{!}} width=80 {{!}} <div>'''{{{title14}}}'''</div> {{!!}} {{{data14}}} }}
+
{{#if: {{{data14|}}} | {{!}} width=80 {{!}} <div>'''{{{title14}}}'''</div> {{!!}} {{{data14}}}}}
 
|- valign="top"
 
|- valign="top"
{{#if: {{{data15|}}} | {{!}} width=80 {{!}} <div>'''{{{title15}}}'''</div> {{!!}} {{{data15}}} }}
+
{{#if: {{{data15|}}} | {{!}} width=80 {{!}} <div>'''{{{title15}}}'''</div> {{!!}} {{{data15}}}}}
 
|-
 
|-
  +
|colspan="2"|<!-- Footer navigation --->
 
  +
<!-- Footer area -->
{{#if: {{{prev|}}}|<span style="float:left">[[{{{prev|}}}|◄ {{{prev|}}}]]</span>}}{{#if: {{{next|}}}|<span style="float:right">[[{{{next|}}}|{{{next|}}} ►]]</span>}}
 
  +
|{{#if: {{{footer|}}}|colspan="2"{{!}} {{{footer|}}}}}
 
|}
 
|}

Latest revision as of 17:02, 18 March 2023

Infobox