Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:ShipBoxTooltip/doc: Difference between revisions

Template page
m Coding and testing.
m Replace hard-coded color with design-token.
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Work in progress|Analyzing the code and related templates and articles to write the doc,|date= 14:49, 1 May 2022 (UTC)}}
; Description
For usage guide please see [[Template:Ship|Ship Template]]
: Creates a tooltip with a subset of the ships stats.
: {{Color box
| color= var(--background-color-error-subtle)
| border= #2F8F2F
| This template is a part of the Ship Database template set and designed to be used in conjunction with the templates on that category and is not meant to be used or called directly!.<br>If you're looking on how to use the '''Ship''' template please see [[Template:Ship|this page]] instead.<br><br>DO NOT EDIT THE CONTENTS OF THIS TEMPLATE IF YOU ARE NOT SURE ON WHAT YOU ARE DOING.
}}


; Description
: This template is a sub-template used to produce a link to a ship which on mouse over shows a tool-tip whit some ship info.
; Dependencies:
; Dependencies:
: Uses:
:; Uses:
:: {{T|Tooltip}}
:: {{T|Tooltip}}
:: Ship information in ship database articles.
:: {{T|Imageserver}} When no local image of ship is available and <kbd>shipid</kbd> is known.
: Called by:
:: Part of the parameter set of {{Tl|ShipArticle}}
:: {{T|Ship}} through ship database articles


; Syntax
; Syntax
: Can <em>not</em> be used on its own.
: ShipBoxTooltip is not to be used on its own. It is to be called by using the wrapper template {{Tl|Ship}}
: {{T|ShipBoxTooltip}} is called when a ship article is called with mode= tooltip. e.g. <nowiki>{{:Vexor|mode= tooltip}}</nowiki> gives {{:Vexor|mode= tooltip}}
 
; Template set
: {{T|ShipArticle}}
: {{T|Ship}}
:: {{T|ShipBoxLarge}}
:: {{T|ShipBoxTooltip}}
 
; Sample
: {{Code|<nowiki>Some text {{Ship|Megathron Navy Issue}} more text.</nowiki>}} gives...
Some text {{Ship|Megathron Navy Issue}} more text.
 


test {{:Vexor|mode= tooltip}} test


; Notes (temp)
{{Bug
: The template does testing for unknown shipname(wel it is actually testing if the parameter contains anything beside white-space), if there is an article about the called ship the shipname should have something in it. If there is no article then ShipBoxTooltip is not called anyway.
|There is a problem with the presentation of the result. See [[Template talk:ShipBoxTooltip]]}}


<includeonly>[[Category:Template]]<!-- Any categories for the template itself --></includeonly>
<includeonly>[[Category:Formatting templates]] [[Category:Data templates]]<!-- Any categories for the template itself --></includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>