Difference between revisions of "User:Flame2512/Tree-Custom"

From War Thunder Wiki
Jump to: navigation, search
(Disable link if not provided)
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
<includeonly><div class="tree-item"><div class="tree-item-background">{{#switch: {{{3}}}
 
<includeonly><div class="tree-item"><div class="tree-item-background">{{#switch: {{{3}}}
  | premium = [[File:Item_prem.png|link={{{2}}}|class=tree-item-js]]
+
  | premium = [[File:Item_prem.png|link={{{2|}}}|class=tree-item-js]]
  | squad = [[File:Item_squad.png|link={{{2}}}|class=tree-item-js]]
+
  | squad = [[File:Item_squad.png|link={{{2|}}}|class=tree-item-js]]
  | #default = [[File:Item_own.png|link={{{2}}}|class=tree-item-js]]
+
  | #default = [[File:Item_own.png|link={{{2|}}}|class=tree-item-js]]
}}</div><div class="tree-item-text"><span class="tree-item-text-scroll">{{{1}}}</span></div><div class="tree-item-img">{{#if: {{{img|}}}|[[File:{{{image}}}]]|{{#if:{{#unit:{{{img_url}}}|icon}}|{{#unit:{{{img_url}}}|icon}}|{{{img_url|}}}}}}}</div></div></includeonly><noinclude>
+
}}</div><div class="tree-item-text"><span class="tree-item-text-scroll">{{{1}}}</span></div><div class="tree-item-img" style="width: 110px; overflow:hidden">{{#if: {{{img|}}}|[[File:{{{img}}}|x66px]]|{{#if:{{#unit:{{{img_url}}}|icon}}|{{#unit:{{{img_url}}}|icon}}|{{{img_url|}}}}}}}</div></div></includeonly><noinclude>
 
== Description ==
 
== Description ==
 
This template is a fully customisable version of [[Template:Tree-Unit]].
 
This template is a fully customisable version of [[Template:Tree-Unit]].
  
 
== Use ==
 
== Use ==
{{Notice|For clarity template parameters are shown on separate lines. In practice this template is probably better used as a single line}}
 
 
<pre>
 
<pre>
{{User:U13682523/Tree-Custom
+
{{User:U13682523/Tree-Custom|Text|Link|Colour|img=|img_url=}}
| text =
+
</pre>
| link =
 
| image =
 
| colour =
 
}}</pre>
 
  
 
== Parameters ==
 
== Parameters ==
* '''text''' - the text to display where the vehicle name would normally be (optional).
+
All parameters are optional and can be left blank if not desired:
* '''link''' - the name of the page the box should link to when clicked (optional).
+
 
* '''image''' - the filename of the image to display where the vehicle icon would go, or a link to an external file, or a vehicle code (optional).
+
* '''Text''' - The first parameter is the text to display
* '''colour''' - the background colour, specify either '''premium''' or '''squad''' or ignore for default colour
+
* '''Link''' - The second parameter is the name of the page the box should link to when clicked
 +
* '''Colour''' - The background colour, specify either '''premium''' or '''squad''' or ignore for default colour
 +
* '''img''' - The filename of the image to display where the vehicle icon would go
 +
* '''img_url''' - The URL of an external file to display, a vehicle code is also accepted. This has no effect if '''img''' is used.
  
 
== Examples of use ==
 
== Examples of use ==
Line 27: Line 25:
 
Linking to the [[Lightning F.6]] page, with a squad coloured background, the text "Random Vehicle", and an image specified by wiki file name:
 
Linking to the [[Lightning F.6]] page, with a squad coloured background, the text "Random Vehicle", and an image specified by wiki file name:
  
{{User:U13682523/Tree-Custom|link=Lightning_F.6|text=Random Vehicle|colour=squad|image=AIShipDM Battleship Tirpitz.png}}
+
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6|squad|img=AIShipDM Battleship Tirpitz.png}}
  
 
<pre>
 
<pre>
{{User:U13682523/Tree-Custom
+
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6|squad|img=AIShipDM Battleship Tirpitz.png}}
| link = Lightning_F.6
 
| text = Random Vehicle
 
| colour = squad
 
| image = AIShipDM Battleship Tirpitz.png
 
}}
 
 
</pre>
 
</pre>
  
Line 41: Line 34:
 
Linking to the [[Lightning F.6]] page, with a premium coloured background, the text "Random Vehicle", and an image specified by an external URL:
 
Linking to the [[Lightning F.6]] page, with a premium coloured background, the text "Random Vehicle", and an image specified by an external URL:
  
{{User:U13682523/Tree-Custom|link=Lightning_F.6|text=Random Vehicle|colour=premium|image=http://encyclopedia.warthunder.com/slots/b-17g.png}}
+
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6|premium|img_url=http://encyclopedia.warthunder.com/slots/b-17g.png}}
  
 
<pre>
 
<pre>
{{User:U13682523/Tree-Custom
+
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6|premium|img_url=http://encyclopedia.warthunder.com/slots/b-17g.png}}
| link = Lightning_F.6
 
| text = Random Vehicle
 
| colour = premium
 
| image = http://encyclopedia.warthunder.com/slots/b-17g.png
 
}}
 
 
</pre>
 
</pre>
  
Line 55: Line 43:
 
Linking to the [[Lightning F.6]] page, with a regular coloured background, the text "Random Vehicle", and an image specified using a vehicle code:
 
Linking to the [[Lightning F.6]] page, with a regular coloured background, the text "Random Vehicle", and an image specified using a vehicle code:
  
{{User:U13682523/Tree-Custom|link=Lightning_F.6|text=Random Vehicle|image=a6m5otsu}}
+
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6||img_url=a6m5otsu}}
  
 
<pre>
 
<pre>
{{User:U13682523/Tree-Custom
+
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6||img_url=a6m5otsu}}
| link = Lightning_F.6
 
| text = Random Vehicle
 
| image = a6m5otsu
 
}}
 
 
</pre>
 
</pre>
  
 
</noinclude>
 
</noinclude>

Latest revision as of 16:09, 10 March 2023

Description

This template is a fully customisable version of Template:Tree-Unit.

Use

{{User:U13682523/Tree-Custom|Text|Link|Colour|img=|img_url=}}

Parameters

All parameters are optional and can be left blank if not desired:

  • Text - The first parameter is the text to display
  • Link - The second parameter is the name of the page the box should link to when clicked
  • Colour - The background colour, specify either premium or squad or ignore for default colour
  • img - The filename of the image to display where the vehicle icon would go
  • img_url - The URL of an external file to display, a vehicle code is also accepted. This has no effect if img is used.

Examples of use

Example #1

Linking to the Lightning F.6 page, with a squad coloured background, the text "Random Vehicle", and an image specified by wiki file name:

Item squad.png
Random vehicle
AIShipDM Battleship Tirpitz.png
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6|squad|img=AIShipDM Battleship Tirpitz.png}}

Example #2

Linking to the Lightning F.6 page, with a premium coloured background, the text "Random Vehicle", and an image specified by an external URL:

Item prem.png
Random vehicle
b-17g.png
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6|premium|img_url=http://encyclopedia.warthunder.com/slots/b-17g.png}}

Example #3

Linking to the Lightning F.6 page, with a regular coloured background, the text "Random Vehicle", and an image specified using a vehicle code:

Item own.png
Random vehicle
a6m5otsu.png
{{User:U13682523/Tree-Custom|Random vehicle|Lightning F.6||img_url=a6m5otsu}}