Template:Skillchain: Difference between revisions
From HorizonXI Wiki
(reworked code to make it cleaner and used property template to display skillchain names with icons) |
m (fixed scrollbar bug by using a wrapper table instead div) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><onlyinclude> | <includeonly><onlyinclude><!-- | ||
{|<!-- | if no namespace (e.g. templates, category pages, ...) then categorize unless last argument is nc or no category | ||
-->{{#if:{{NAMESPACE}}||{{#switch:{{lc:{{{3|{{{2|}}}}}}}}|nc|no category=|#default={{#switch:{{lc:{{{1}}}}}|light = [[Category:Light (Skillchain)]]|[[Category:{{ucfirst:{{{1}}}}}]]}}}}}}<!-- | |||
using a wrapper table because a div causes mediawiki to force unnecessary scrollbars | |||
-->{{#if:{{{width|}}}| | --> | ||
| | <table style="width: {{#if:{{{width|}}}|{{{width}}}|fit-content}}; overflow: hidden;"><tr><td> | ||
<!-- | |||
The Skillchain name as colored header | The Skillchain name as colored header | ||
Line 28: | Line 30: | ||
Level 3 Skillchain Box. Hide box if skillchain doesn't take part in Level 3 | Level 3 Skillchain Box. Hide box if skillchain doesn't take part in Level 3 | ||
--> | --><div style="margin: 4px;"></div> | ||
<table style="width: 100%; padding: 4px; border: solid 1px #CC7700; background:#FFEEDD; {{#switch:{{lc:{{{1}}}}} | |||
| light | darkness | fusion | fragmentation | gravitation | distortion = | | light | darkness | fusion | fragmentation | gravitation | distortion = | ||
| #default = | | #default = display: none; | ||
}} | }}"> | ||
<tr> | |||
<th colspan="5">Level 3 Skillchains</th> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|light=|#default=display:none;}}"> | |||
{{# | <td>{{Property|Light|icon|plain}}</td> | ||
<td>→</td> | |||
<td>{{Property|Light|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Light|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|fusion|fragmentation|light=|#default=display:none;}}"> | |||
<td>{{Property|Fusion|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Fragmentation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Light|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|fragmentation|fusion|light=|#default=display:none;}}"> | |||
{{ | <td>{{Property|Fragmentation|icon|plain}}</td> | ||
<td>→</td> | |||
<td>{{Property|Fusion|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Light|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|darkness=|#default=display:none;}}"> | |||
<td>{{Property|Darkness|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Darkness|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Darkness|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|gravitation|distortion|darkness=|#default=display:none;}}"> | |||
<td>{{Property|Gravitation|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Distortion|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Darkness|icon|plain}}</td> | |||
</tr> | |||
{{ | <tr style="{{#switch:{{lc:{{{1}}}}}|distortion|gravitation|darkness=|#default=display:none;}}"> | ||
<td>{{Property|Distortion|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Gravitation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Darkness|icon|plain}}</td> | |||
</tr> | |||
</table> | |||
<div style="margin: 4px;"></div> | |||
<!-- | |||
Level 2 Skillchain Box. Hide box if skillchain doesn't take part in Level 2 | Level 2 Skillchain Box. Hide box if skillchain doesn't take part in Level 2 | ||
--> | --> | ||
<table style="width: 100%; padding: 4px; border: solid 1px #CC7700; background:#FFEEDD; {{#switch:{{lc:{{{1}}}}} | |||
| liquefaction | impaction | distortion | fusion | induration | reverberation | gravitation | fragmentation | detonation | compression | transfixion | scission = | | liquefaction | impaction | distortion | fusion | induration | reverberation | gravitation | fragmentation | detonation | compression | transfixion | scission = | ||
| #default = | | #default = display:none; | ||
}} | }}"> | ||
<tr> | |||
<th colspan="5">Level 2 Skillchains</th> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|liquefaction|impaction|fusion=|#default=display:none;}}"> | |||
{{# | <td>{{Property|Liquefaction|icon|plain}}</td> | ||
<td>→</td> | |||
<td>{{Property|Impaction|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Fusion|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|distortion|fusion=|#default=display:none;}}"> | |||
<td>{{Property|Distortion|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Fusion|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Fusion|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|induration|reverberation|fragmentation=|#default=display:none;}}"> | |||
<td>{{Property|Induration|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Reverberation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Fragmentation|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|gravitation|fragmentation=|#default=display:none;}}"> | |||
<td>{{Property|Gravitation|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Fragmentation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Fragmentation|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|detonation|compression|gravitation=|#default=display:none;}}"> | |||
<td>{{Property|Detonation|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Gravitation|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|fusion|gravitation=|#default=display:none;}}"> | |||
<td>{{Property|Fusion|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Gravitation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Gravitation|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|transfixion|scission|distortion=|#default=display:none;}}"> | |||
<td>{{Property|Transfixion|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Distortion|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|fragmentation|distortion=|#default=display:none;}}"> | |||
<td>{{Property|Fragmentation|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Distortion|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Distortion|icon|plain}}</td> | |||
</tr> | |||
</table> | |||
<div style="margin: 4px;"></div> | |||
<!-- | |||
Level 1 Skillchain Box. Hide box if skillchain doesn't take part in Level 1 | Level 1 Skillchain Box. Hide box if skillchain doesn't take part in Level 1 | ||
--> | --> | ||
<table style="width: 100%; padding: 4px; border: solid 1px #CC7700; background:#FFEEDD; {{#switch:{{lc:{{{1}}}}} | |||
| impaction | liquefaction | scission | reverberation | detonation | compression | transfixion | induration = | | impaction | liquefaction | scission | reverberation | detonation | compression | transfixion | induration = | ||
| #default = | | #default = display:none; | ||
}} | }}"> | ||
<tr> | |||
<th colspan="5">Level 1 Skillchains</th> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|impaction|liquefaction=|#default=display:none;}}"> | |||
{{# | <td>{{Property|Impaction|icon|plain}}</td> | ||
<td>→</td> | |||
<td>{{Property|Liquefaction|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Liquefaction|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|scission|liquefaction=|#default=display:none;}}"> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
<td>→</td> | |||
{{ | <td>{{Property|Liquefaction|icon|plain}}</td> | ||
<td>=</td> | |||
<td>{{Property|Liquefaction|icon|plain}}</td> | |||
{{ | </tr> | ||
<tr style="{{#switch:{{lc:{{{1}}}}}|reverberation|impaction=|#default=display:none;}}"> | |||
<td>{{Property|Reverberation|icon|plain}}</td> | |||
{{ | <td>→</td> | ||
<td>{{Property|Impaction|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Impaction|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|induration|impaction=|#default=display:none;}}"> | |||
<td>{{Property|Induration|icon|plain}}</td> | |||
{{ | <td>→</td> | ||
<td>{{Property|Impaction|icon|plain}}</td> | |||
{{ | <td>=</td> | ||
<td>{{Property|Impaction|icon|plain}}</td> | |||
{{ | </tr> | ||
<tr style="{{#switch:{{lc:{{{1}}}}}|impaction|detonation=|#default=display:none;}}"> | |||
}}{{ | <td>{{Property|Impaction|icon|plain}}</td> | ||
{{ | <td>→</td> | ||
<td>{{Property|Detonation|icon|plain}}</td> | |||
<td>=</td> | |||
{{ | <td>{{Property|Detonation|icon|plain}}</td> | ||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|compression|detonation=|#default=display:none;}}"> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
<td>→</td> | |||
{{ | <td>{{Property|Detonation|icon|plain}}</td> | ||
{{ | <td>=</td> | ||
{{ | <td>{{Property|Detonation|icon|plain}}</td> | ||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|scission|detonation=|#default=display:none;}}"> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Detonation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Detonation|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|liquefaction|scission=|#default=display:none;}}"> | |||
<td>{{Property|Liquefaction|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
{{ | </tr> | ||
<tr style="{{#switch:{{lc:{{{1}}}}}|detonation|scission=|#default=display:none;}}"> | |||
<td>{{Property|Detonation|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Scission|icon|plain}}</td> | |||
{{ | </tr> | ||
{{ | <tr style="{{#switch:{{lc:{{{1}}}}}|transfixion|reverberation=|#default=display:none;}}"> | ||
}} | <td>{{Property|Transfixion|icon|plain}}</td> | ||
<td>→</td> | |||
<td>{{Property|Reverberation|icon|plain}}</td> | |||
{{ | <td>=</td> | ||
{{ | <td>{{Property|Reverberation|icon|plain}}</td> | ||
{{ | </tr> | ||
<tr style="{{#switch:{{lc:{{{1}}}}}|scission|reverberation=|#default=display:none;}}"> | |||
}}{{ | <td>{{Property|Scission|icon|plain}}</td> | ||
<td>→</td> | |||
<td>{{Property|Reverberation|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Reverberation|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|reverberation|induration=|#default=display:none;}}"> | |||
<td>{{Property|Reverberation|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Induration|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Induration|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|induration|compression=|#default=display:none;}}"> | |||
<td>{{Property|Induration|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|transfixion|compression=|#default=display:none;}}"> | |||
<td>{{Property|Transfixion|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
</tr> | |||
<tr style="{{#switch:{{lc:{{{1}}}}}|compression|transfixion=|#default=display:none;}}"> | |||
<td>{{Property|Compression|icon|plain}}</td> | |||
<td>→</td> | |||
<td>{{Property|Transfixion|icon|plain}}</td> | |||
<td>=</td> | |||
<td>{{Property|Transfixion|icon|plain}}</td> | |||
</tr> | |||
</table> | |||
<!-- | |||
--> | --> | ||
</td></tr></table></onlyinclude></includeonly> | |||
[[Category:Templates|{{PAGENAME}}]] | [[Category:Templates|{{PAGENAME}}]] | ||
==Usage== | ==Usage== | ||
Line 308: | Line 308: | ||
| {{Skillchain|Fragmentation|A}} | | {{Skillchain|Fragmentation|A}} | ||
|} | |} | ||
===Usage as Tooltips=== | |||
The template was rewritten in html instead of mediawiki table syntax to allow usage in [[:Template:Tooltip]] like this: | |||
<pre>{{Tooltip|text={{Property|Fragmentation}}|tooltip={{Skillchain|Fragmentation}}}}</pre> | |||
{{Tooltip|text={{Property|Fragmentation}}|tooltip={{Skillchain|Fragmentation}}}} |
Latest revision as of 22:44, 25 November 2023
Usage
{{Skillchain|<skillchain property>|<skillchain priority>}}
- Displays a table of all skillchains that can be produced by opening or closing with the given skillchain property and categorizes the page into the skillchain property's category. The skillchain priority value is optional.
- width: optional value to specify a specific width for the table.
Examples
Code | Result |
---|---|
{{Skillchain|Impaction}} |
|
{{Skillchain|Gravitation}} |
|
{{Skillchain|Light}} |
|
{{Skillchain|Light|width="100%"}} |
|
{{Skillchain|Transfixion|A}} |
|
{{Skillchain|Distortion|A}} |
|
{{Skillchain|Fusion|A}} |
|
{{Skillchain|Fragmentation|A}} |
Usage as Tooltips
The template was rewritten in html instead of mediawiki table syntax to allow usage in Template:Tooltip like this:
{{Tooltip|text={{Property|Fragmentation}}|tooltip={{Skillchain|Fragmentation}}}}Fragmentation