Difference between revisions of "Template:Tree-Start/Documentation"

From War Thunder Wiki
Jump to: navigation, search
(Fixed formatting)
(Reworked entire page)
Line 1: Line 1:
 
{{docpage}}
 
{{docpage}}
  
This template is used to create a header for a vehicle navigation table. There is a parameter that must be set for the template to function properly, which is the number of vehicle columns (5, 6, or 7). There is also an optional second parameter, which removes the header with the “Researchable Vehicles” and “Premium Vehicles” lines.
+
This template is used at the start of a navigation table to define the number of columns and create a header. There are 2 main parameters:
 +
* the number of vehicle columns,
 +
* the removal of the header ("Researchable Vehicles" & "Premium Vehicles").
  
The template is used in combination with the [[Template:Tree-Line]] and [[Template:Tree-End]] templates. It can also be used together with the [[Template:Tree-Group-Start]] template.
 
 
Main rules of using the template:
 
 
{| class="wikitable"
 
{| class="wikitable"
! Example !! Code !! colspan="3" | Result
+
! width="30%" | Parameter !! width="30%" | Code !! width="25%" | Result !! width="15%" | Example
 +
|-
 +
| rowspan="3" | The number of vehicle columns in the navigation table for each nation is set to a fixed number (5, 6 or 7). 2 columns are reserved for premium vehicles (on the right), the rest is for researchable vehicles. When using the template for a nation tree, the second parameter is not used. If you set the parameter to a different number, it will cause the header to mismatch the actual columns in the tree. || <pre>{{Tree-Start|7}}</pre> || Researchable vehicles: 5 columns <br> Premium vehicles: 2 columns || [[:Category:USA aircraft]]
 +
|-
 +
| <pre>{{Tree-Start|6}}</pre> || Researchable vehicles: 4 columns <br> Premium vehicles: 2 columns || [[:Category:China aircraft]]
 +
|-
 +
| <pre>{{Tree-Start|5}}</pre> || Researchable vehicles: 3 columns <br> Premium vehicles: 2 columns || [[:Category:Sweden aircraft]]
 
|-
 
|-
| The [[Template:Tree-Arrow]] used in between linear vehicles is the same one as the one used in the client. There must be no spaces or <nowiki><br></nowiki> tags present. If necessary, it's possible to make the arrow longer by setting an additional parameter.
 
| <pre>{{Tree-Unit|p-26a_34_m2}}
 
{{Tree-Arrow}}
 
{{Tree-Unit|p-26a_33}}</pre>
 
| style="text-align:center;" colspan="3" |
 
{{Tree-Unit|p-26a_34_m2}}
 
{{Tree-Arrow}}
 
{{Tree-Unit|p-26a_33}}
 
 
|-
 
|-
| The [[Template:Tree-Arrow-Right]] used in between vehicles is the same one as the one used in the client. There must be no spaces or <nowiki><br></nowiki> tags present. If necessary, it's possible to make the arrow longer by setting an additional parameter.
+
| rowspan="2" | For custom navigation tables, you can remove the preset header to remplace it with a custom one. When defining this second parameter, the first parameter (number of columns) plays no role and can be left blank. With the header hidden, the number of columns in the table is defined by the user and no longer limited to 5, 6 or 7. || <pre>{{Tree-Start|6|without header}}</pre> || rowspan="2" | The header "Researchable Vehicles" / "Premium Vehicles" is hidden. || [[Add-on Armor]]
| <pre>{{Tree-Unit|p-26a_34_m2}} || {{Tree-Arrow-Right}} || {{Tree-Unit|p-26a_33}}</pre>
 
| style="text-align:center;" | {{Tree-Unit|p-26a_34_m2}} || {{Tree-Arrow-Right}} || {{Tree-Unit|p-26a_33}}
 
 
|-
 
|-
| The [[Template:Tree-Skip]] is usually used in between premium and gift vehicles. It should contain no spaces or <nowiki><br></nowiki> tags as well. If necessary, it's possible to make the space shorter or longer by setting an additional parameter.
+
| <pre>{{Tree-Start||without header}}</pre> ||
| <pre>{{Tree-Unit-Prem|p-26a_34}}
 
{{Tree-Skip}}
 
{{Tree-Unit-Prem|b_10b}}</pre>
 
| style="text-align:center;" colspan="3" |
 
{{Tree-Unit-Prem|p-26a_34}}
 
{{Tree-Skip}}
 
{{Tree-Unit-Prem|b_10b}}
 
 
|-
 
|-
| For more information about folders that merge vehicle groups, please see the corresponding [[Template:Tree-Group-Start|template page]].
 
| <pre>{{Tree-Group-Start}}
 
{{Tree-Unit|f4f-3}}
 
{{Tree-Arrow}}
 
{{Tree-Unit|f4f-4}}
 
{{Tree-Group-End|f4f_group|F4F}}</pre>
 
|style="text-align:center;vertical-align:top;height:170px;" colspan="3" |
 
{{Tree-Group-Start}}
 
{{Tree-Unit|f4f-3}}
 
{{Tree-Arrow}}
 
{{Tree-Unit|f4f-4}}
 
{{Tree-Group-End|f4f_group|F4F}}
 
 
|}
 
|}
  
Clean template source codes:
+
Here under you will find clean source codes to create your own navigation table:
{{Sp-begin|Code with 7 columns}}
+
{{Sp-begin|Navigation table with 7 columns}}
 
<pre style="text-align:left;">{{Tree-Start|7}}
 
<pre style="text-align:left;">{{Tree-Start|7}}
 
{{Tree-Line|I rank}}
 
{{Tree-Line|I rank}}
Line 147: Line 123:
 
{{Sp-end}}
 
{{Sp-end}}
  
{{Sp-begin|Code with 6 columns}}
+
{{Sp-begin|Navigation table with 6 columns}}
 
<pre style="text-align:left;">{{Tree-Start|6}}
 
<pre style="text-align:left;">{{Tree-Start|6}}
 
{{Tree-Line|I rank}}
 
{{Tree-Line|I rank}}
Line 236: Line 212:
 
{{Sp-end}}
 
{{Sp-end}}
  
{{Sp-begin|Code with 5 columns}}
+
{{Sp-begin|Navigation table with 5 columns}}
 
<pre style="text-align:left;">{{Tree-Start|5}}
 
<pre style="text-align:left;">{{Tree-Start|5}}
 
{{Tree-Line|I rank}}
 
{{Tree-Line|I rank}}
Line 312: Line 288:
 
{{Tree-End}}</pre>
 
{{Tree-End}}</pre>
 
{{Sp-end}}
 
{{Sp-end}}
 +
 +
The template ''Tree-Start'' is used in combination with the template [[Template:Tree-End]]. Each tree opened with ''Tree-Start'' must be closed with ''Tree-End''.
 +
 +
The following templates are also usually used in the navigation table:
 +
* [[Template:Tree-Unit]]
 +
* [[Template:Tree-Line]]
 +
* [[Template:Tree-Arrow]]
 +
* [[Template:Tree-Arrow-Right]]
 +
* [[Template:Tree-Skip]]
 +
* [[Template:Tree-Group-Start]]
 +
* [[Template:Tree-Group-End]]
 +
Read the documentation about these templates to get familiar with their use.
 +
 +
{| class="wikitable"
 +
! Example !! Code !! colspan="3" | Result
 +
|-
 +
| The [[Template:Tree-Arrow]] used in between linear vehicles is the same one as the one used in the client. There must be no spaces or <nowiki><br></nowiki> tags present. If necessary, it's possible to make the arrow longer by setting an additional parameter.
 +
| <pre>{{Tree-Unit|p-26a_34_m2}}
 +
{{Tree-Arrow}}
 +
{{Tree-Unit|p-26a_33}}</pre>
 +
| style="text-align:center;" colspan="3" |
 +
{{Tree-Unit|p-26a_34_m2}}
 +
{{Tree-Arrow}}
 +
{{Tree-Unit|p-26a_33}}
 +
|-
 +
| The [[Template:Tree-Arrow-Right]] used in between vehicles is the same one as the one used in the client. There must be no spaces or <nowiki><br></nowiki> tags present. If necessary, it's possible to make the arrow longer by setting an additional parameter.
 +
| <pre>{{Tree-Unit|p-26a_34_m2}} || {{Tree-Arrow-Right}} || {{Tree-Unit|p-26a_33}}</pre>
 +
| style="text-align:center;" | {{Tree-Unit|p-26a_34_m2}} || {{Tree-Arrow-Right}} || {{Tree-Unit|p-26a_33}}
 +
|-
 +
| The [[Template:Tree-Skip]] is usually used in between premium and gift vehicles. It should contain no spaces or <nowiki><br></nowiki> tags as well. If necessary, it's possible to make the space shorter or longer by setting an additional parameter.
 +
| <pre>{{Tree-Unit-Prem|p-26a_34}}
 +
{{Tree-Skip}}
 +
{{Tree-Unit-Prem|b_10b}}</pre>
 +
| style="text-align:center;" colspan="3" |
 +
{{Tree-Unit-Prem|p-26a_34}}
 +
{{Tree-Skip}}
 +
{{Tree-Unit-Prem|b_10b}}
 +
|-
 +
| For more information about folders that merge vehicle groups, please see the corresponding [[Template:Tree-Group-Start|template page]].
 +
| <pre>{{Tree-Group-Start}}
 +
{{Tree-Unit|f4f-3}}
 +
{{Tree-Arrow}}
 +
{{Tree-Unit|f4f-4}}
 +
{{Tree-Group-End|f4f_group|F4F}}</pre>
 +
|style="text-align:center;vertical-align:top;height:170px;" colspan="3" |
 +
{{Tree-Group-Start}}
 +
{{Tree-Unit|f4f-3}}
 +
{{Tree-Arrow}}
 +
{{Tree-Unit|f4f-4}}
 +
{{Tree-Group-End|f4f_group|F4F}}
 +
|}

Revision as of 23:33, 21 November 2020

This template is used at the start of a navigation table to define the number of columns and create a header. There are 2 main parameters:

  • the number of vehicle columns,
  • the removal of the header ("Researchable Vehicles" & "Premium Vehicles").
Parameter Code Result Example
The number of vehicle columns in the navigation table for each nation is set to a fixed number (5, 6 or 7). 2 columns are reserved for premium vehicles (on the right), the rest is for researchable vehicles. When using the template for a nation tree, the second parameter is not used. If you set the parameter to a different number, it will cause the header to mismatch the actual columns in the tree.
{{Tree-Start|7}}
Researchable vehicles: 5 columns
Premium vehicles: 2 columns
Category:USA aircraft
{{Tree-Start|6}}
Researchable vehicles: 4 columns
Premium vehicles: 2 columns
Category:China aircraft
{{Tree-Start|5}}
Researchable vehicles: 3 columns
Premium vehicles: 2 columns
Category:Sweden aircraft
For custom navigation tables, you can remove the preset header to remplace it with a custom one. When defining this second parameter, the first parameter (number of columns) plays no role and can be left blank. With the header hidden, the number of columns in the table is defined by the user and no longer limited to 5, 6 or 7.
{{Tree-Start|6|without header}}
The header "Researchable Vehicles" / "Premium Vehicles" is hidden. Add-on Armor
{{Tree-Start||without header}}

Here under you will find clean source codes to create your own navigation table:




The template Tree-Start is used in combination with the template Template:Tree-End. Each tree opened with Tree-Start must be closed with Tree-End.

The following templates are also usually used in the navigation table:

Read the documentation about these templates to get familiar with their use.

Example Code Result
The Template:Tree-Arrow used in between linear vehicles is the same one as the one used in the client. There must be no spaces or <br> tags present. If necessary, it's possible to make the arrow longer by setting an additional parameter.
{{Tree-Unit|p-26a_34_m2}}
{{Tree-Arrow}}
{{Tree-Unit|p-26a_33}}
Item own.png
P-26A-34 M2
p-26a_34_m2.png
Arrow.png
Item own.png
P-26A-33
p-26a_33.png
The Template:Tree-Arrow-Right used in between vehicles is the same one as the one used in the client. There must be no spaces or <br> tags present. If necessary, it's possible to make the arrow longer by setting an additional parameter.
{{Tree-Unit|p-26a_34_m2}} || {{Tree-Arrow-Right}} || {{Tree-Unit|p-26a_33}}
Item own.png
P-26A-34 M2
p-26a_34_m2.png
Arrow-left.png
Item own.png
P-26A-33
p-26a_33.png
The Template:Tree-Skip is usually used in between premium and gift vehicles. It should contain no spaces or <br> tags as well. If necessary, it's possible to make the space shorter or longer by setting an additional parameter.
{{Tree-Unit-Prem|p-26a_34}}
{{Tree-Skip}}
{{Tree-Unit-Prem|b_10b}}
Item prem.png
P-26A-34
p-26a_34.png
Item prem.png
B-10B
b_10b.png
For more information about folders that merge vehicle groups, please see the corresponding template page.
{{Tree-Group-Start}}
{{Tree-Unit|f4f-3}}
{{Tree-Arrow}}
{{Tree-Unit|f4f-4}}
{{Tree-Group-End|f4f_group|F4F}}
Item own.png
F4F-3
f4f-3.png
Arrow.png
Item own.png
F4F-4
f4f-4.png
F4F
f4f_group.png