• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Template:Equipment"

From Kancolle Wiki
Jump to navigation Jump to search
 
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly>
+
<includeonly>{{#vardefine:info|{{#invoke:EquipmentPage|info|pagename={{{1|{{PAGENAME}}}}}}}}}{{#vardefine:info_en|{{#invoke:EquipmentPage|info_en|pagename={{{1|{{PAGENAME}}}}}}}}}{{#vardefine:wikipedia|{{#invoke:EquipmentPage|wikipedia|pagename={{{1|{{PAGENAME}}}}}}}}}{{#vardefine:buildable|{{#invoke:EquipmentPage|buildable|pagename={{{1|{{PAGENAME}}}}}}}}}{{#vardefine:improvable|{{#invoke:EquipmentPage|improvable|pagename={{{1|{{PAGENAME}}}}}}}}}{{EquipmentInfoKai|{{{1|{{PAGENAME}}}}}}}{{EquipmentCategoriesKai|{{{1|{{PAGENAME}}}}}}}
{{EquipmentInfoKai|{{{1|{{PAGENAME}}}}}}}
+
{{#if:{{{toc|}}}|{{TOC left}}|__NOTOC__}}<h2>Introduction</h2>
{{EquipmentCategoriesKai|{{{1|{{PAGENAME}}}}}}}
+
<p lang="ja">{{#if:{{#var:info}}|{{#var:info}}|{{#if:{{{ja|}}}|{{{ja}}}|?}}}}</p>
<h2>Introduction</h2>
+
<p>''{{#if:{{#var:info_en}}|{{#var:info_en}}|{{#if:{{{en|}}}|{{{en}}}|?}}}}''</p>{{#if:{{{header|}}}||
<p>{{{ja|?}}}</p>
 
<p>''{{{en|?}}}''</p>
 
 
<h2>Notes</h2>
 
<h2>Notes</h2>
'''{{#if:{{{buildable|}}}|Buildable|Unbuildable}}'''
+
'''{{#if:{{#var:buildable}}|Buildable|Unbuildable}}'''
 
{{#categorytree:Ships with {{{1|{{PAGENAME}}}}} as stock equipment|mode=pages|depth=0}}
 
{{#categorytree:Ships with {{{1|{{PAGENAME}}}}} as stock equipment|mode=pages|depth=0}}
 
{{#categorytree:Equipment that consume {{{1|{{PAGENAME}}}}} during improvement|mode=pages|depth=0}}
 
{{#categorytree:Equipment that consume {{{1|{{PAGENAME}}}}} during improvement|mode=pages|depth=0}}
{{{notes|}}}
+
{{{notes|}}}{{clear}}
{{clear}}
+
{{#if:{{#var:improvable}}|<h2>Improvement</h2>
{{#if:{{{improvement|}}}|<h2>Improvement</h2>{{ImprovementTableKai|{{{1|{{PAGENAME}}}}}|categories=true}}}}
+
{{ImprovementTableKai|{{{1|{{PAGENAME}}}}}|categories=true}}}}
{{#if:{{{trivia|}}}|<h2>Trivia</h2>{{{trivia}}}}}
+
{{#ifexist:{{{1|{{PAGENAME}}}}}/Bonuses|<h2>Bonuses</h2>
{{#if:{{{see also|}}}|<h2>See also</h2>{{{see also}}}{{Equipmentlist}}}}
+
[[Category:Equipment with bonuses]]
</includeonly>
+
{{:{{{1|{{PAGENAME}}}}}/Bonuses}}}}
<noinclude>
+
{{#if:{{{trivia|}}}|<h2>Trivia</h2>{{#if:{{{collapsed|}}}|<div class="mw-collapsible mw-collapsed">}}
 +
{{{trivia}}}{{#if:{{{collapsed|}}}|</div>{{clear}}}}}}
 +
{{#if:{{#var:wikipedia}}|{{#if:{{{see also|}}}|<h2>See also</h2>
 +
*{{#var:wikipedia}}
 +
{{{see also}}}|<h2>See also</h2>
 +
*{{#var:wikipedia}}}}|{{#if:{{{see also|}}}|<h2>See also</h2>
 +
{{{see also}}}}}}}
 +
{{#if:{{{test|}}}|{{Equipmentlist/Test}}|{{Equipmentlist}}}}}}</includeonly><noinclude>
 
Layout template for [[:Category:Player equipment|equipment pages]].
 
Layout template for [[:Category:Player equipment|equipment pages]].
 +
 +
The general layout that can be generated is:
 +
*Infobox
 +
*Automatic categories
 +
*Introduction section: Japanese and English descriptions
 +
*Notes section: Buildable/Unbuildable note, category trees, notes text, section clear
 +
*Improvement section if equipment is improvable
 +
*Bonuses section, if <code>/Bonuses</code> subpage exists.
 +
*Trivia section
 +
*See also section: Wikipedia and other links
 +
*Navbox.
  
 
==Parameters==
 
==Parameters==
{{todo|show=true|Get '''buildable''' and '''improvement''' from Lua instead.}}
+
*'''[1]''': equipment name, <code>PAGENAME</code> is used by default.
*'''1''': equipment name, <code>PAGENAME</code> is used by default.
+
*'''ja''': Japanese description of the equipment, defaults to <code>_info</code> (<code>api_info</code>) from equipment data module or to <code>?</code> when there is no <code>_info</code>.
*'''ja''': Japanese description of the equipment, defaults to <code>?</code>.
+
*'''en''': English description of the equipment, defaults to <code>?</code> from equipment data module or to <code>?</code> when there is no <code>_info</code>..
*'''en''': English description of the equipment, defaults to <code>?</code>.
 
*'''buildable''': set to <code>true</code> if equipment is buildable.
 
*'''improvement''': set to <code>true</code> if equipment is improvable.
 
 
*'''notes''': text in notes section.
 
*'''notes''': text in notes section.
*'''trivia ''': text in trivia section (optional).
+
*'''trivia ''': text in optional trivia section.
*'''see also''': text in see also section (optional).
+
**'''collapsed''': set to have collapsed trivia section (e.g., for long write-ups).
 +
*'''see also''': text in optional see also section.
 +
*'''header''': set to ignore and not generate anything after category tree (notes text and clear, improvement, trivia, see also sections, navbox).
 +
*'''toc''': add the TOC.
 +
 
 +
===Lua parameters===
 +
The following equipment data module fields are used:
 +
*<code>_info</code> for '''ja'''
 +
*<code>_wikipedia</code> for Wikipedia link in optional see also section.
 +
*<code>_buildable</code> for Buildable/Unbuildable note
 +
*<code>_improvements</code> for optional improvement section.
  
 
==Usage==
 
==Usage==
 
Full page:
 
Full page:
 
<pre>
 
<pre>
{{EquipmentPageHeader
+
{{Equipment
|ja =
+
 
 
|en =  
 
|en =  
|buildable =
+
 
|improvement =
 
 
|notes =  
 
|notes =  
 +
 
|trivia =  
 
|trivia =  
 +
 
|see also =  
 
|see also =  
 +
 
}}
 
}}
 
</pre>
 
</pre>
 
Or only for the header (from infobox to category tree):
 
Or only for the header (from infobox to category tree):
 
<pre>
 
<pre>
{{EquipmentPageHeader
+
{{Equipment
|ja =  
+
 
 +
|header = true
 +
 
 
|en =  
 
|en =  
|buildable =
+
 
 
}}
 
}}
 
...
 
...
 
</pre>
 
</pre>
 
</noinclude>
 
</noinclude>

Latest revision as of 06:11, 4 July 2024

Layout template for equipment pages.

The general layout that can be generated is:

  • Infobox
  • Automatic categories
  • Introduction section: Japanese and English descriptions
  • Notes section: Buildable/Unbuildable note, category trees, notes text, section clear
  • Improvement section if equipment is improvable
  • Bonuses section, if /Bonuses subpage exists.
  • Trivia section
  • See also section: Wikipedia and other links
  • Navbox.

Parameters

  • [1]: equipment name, PAGENAME is used by default.
  • ja: Japanese description of the equipment, defaults to _info (api_info) from equipment data module or to ? when there is no _info.
  • en: English description of the equipment, defaults to ? from equipment data module or to ? when there is no _info..
  • notes: text in notes section.
  • trivia : text in optional trivia section.
    • collapsed: set to have collapsed trivia section (e.g., for long write-ups).
  • see also: text in optional see also section.
  • header: set to ignore and not generate anything after category tree (notes text and clear, improvement, trivia, see also sections, navbox).
  • toc: add the TOC.

Lua parameters

The following equipment data module fields are used:

  • _info for ja
  • _wikipedia for Wikipedia link in optional see also section.
  • _buildable for Buildable/Unbuildable note
  • _improvements for optional improvement section.

Usage

Full page:

{{Equipment

|en = 

|notes = 

|trivia = 

|see also = 

}}

Or only for the header (from infobox to category tree):

{{Equipment

|header = true

|en = 

}}
...