Difference between revisions of "Template:Ability (LW2)/doc"
m |
m |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | Ability template documentation. |
||
⚫ | |||
+ | |||
⚫ | |||
<pre> |
<pre> |
||
+ | <!-- NOTICE TO EDITORS: For the sake of future maintainability, please do not remove parameters nor rearrange them. This will make it easier in future to update this template using a bot and regular expressions if necessary. |
||
− | {{Ability_(LW2) |
+ | --><includeonly>{{Ability_(LW2) |
− | | s_image = |
||
− | | |
+ | | s_image = |
− | | |
+ | | s_caption = |
− | | |
+ | | s_link = |
+ | | s_name = |
||
− | | s_info = {{ {{subst:FULLPAGENAME}}/Info }} |
||
+ | | s_descr = |
||
⚫ | |||
− | | |
+ | | s_id = |
− | | |
+ | | s_templateName = {{subst:FULLPAGENAME}} |
⚫ | |||
− | }} |
||
+ | | b_descr = {{{ b_descr | {{Ability (LW2)/Constants | b_DESCR }} }}} |
||
+ | | b_info = {{{ b_info | {{Ability (LW2)/Constants | b_INFO }} }}} |
||
+ | | b_table = {{{ b_table | {{Ability (LW2)/Constants | b_TABLE }} }}} |
||
+ | }}</includeonly> |
||
</pre> |
</pre> |
||
==Parameters== |
==Parameters== |
||
− | + | {{Par|s_image|Image filename without link or prefix, but including extension, e.g. <code>Image_name.jpg</code>. This get's expanded in the template to <code>[[File:Image_name.jpg|blahblah]]</code>}} |
|
+ | |||
⚫ | |||
+ | {{Par|s_link|Title of page on wiki or URL for the main image to link to. Do not use this to link to a template page! It should lead to a content page in the Main namespace. See <code>s_templateName</code> below for that.}} |
||
⚫ | |||
− | + | {{Par|s_name|The perk/ability name.}} |
|
− | + | {{Par|s_descr|A (shortish) description of the perk.}} |
|
+ | {{Par|s_id|ID of HTML elements. This should contain no special characters, no spaces, and must be unique across the wiki for future compability. A good option is the ability's name suffixed with the game it belongs to, e.g. on the {{tl|Aggression (LW2)}} template it would read <code>aggressionLW</code> (yes, the beginning lowercase is intentional; please useCamelCase.)}} |
||
− | <code>s_info</code> : Rollover text for the info icon. In practice this should always point to the template's <code>Info</code> subpage via transclusion (see skeleton above) so that it can be referenced elsewhere easily. |
||
+ | {{Par|s_templateName|The base name of the ability template page, including namespace. E.g. for {{tl|Aggression (LW2)}} this value will read <code>Template:Aggression (LW2)</code>. The function in the skeleton will do this for you the first time the page is saved.}} |
||
⚫ | |||
+ | === Passthroughs === |
||
⚫ | |||
+ | '''This section of the skeleton should not be modified nor ommitted.''' |
||
⚫ | |||
+ | The calls to {{tl|Ability (LW2)/Constants}} return default values to be used by all ability templates. This permits users to declare, or not, any of these parameters when calling a perk template, e.g. {{tl|Aggression (LW2)}}. Doing so will override the default value. |
||
− | ===Notes About the Boolean Parameters=== |
||
⚫ | |||
− | The skeleton above treats these as passthroughs. It is expected that these parameters will be set wherever someone wants to include the ability info, and ''not'' inside the template itself. The skeleton above will take the parameters given from the initial call (say from the Main Page) and pass them on to this template. |
||
⚫ | |||
− | If that didn't make sense, look at [[:Category:Perks (Long War 2)]] for examples. |
||
⚫ | |||
⚫ | |||
+ | {{Par|b_table|Set if extra padding should be added. This is intended for use in tables, such as {{tl|Class Tree (LW2)}}. 0: Never have extra padding. 1: Always have extra padding. Default: 0. }} |
||
− | ===Fixed=== |
||
+ | === Depreciated or Removed === |
||
− | If using this in [[Template:Class_Tree_(LW2)]] you need to add a line break after this template. |
||
+ | {{Par|s_info| Removed {{#time: d-M-Y | 20170204055325 }} . Was previously used to add info rollover text. This text has since been moved to the /Info subpage of each ability template. Superceded by s_templateName.}} |
||
− | <strike>If this template is used inside a [[Template:Class_Tree_(LW2)]] and <code>b_info</code> is not <code>true</code>, then for some blasted reason the text overflows the cells. With <code>b_info</code> set, the text behaves and stays inside the table's cells as they should. (How very, very annoying.) |
||
⚫ | |||
− | The text also behaves if this template is instead used inside a subst: version of the Class_Tree template. It could be some weird issue with the parser/template-rendering-parsing-dohicky. |
||
+ | None known. |
||
− | Update: It appears that for some reason, the subst: version has a bunch of line breaks it in the source code. Weird.</strike> |
||
− | [[Category:Documentation]] |
+ | <noinclude>[[Category:Documentation]]</noinclude> |
Latest revision as of 08:44, 12 February 2017
Ability template documentation.
Skeleton
<!-- NOTICE TO EDITORS: For the sake of future maintainability, please do not remove parameters nor rearrange them. This will make it easier in future to update this template using a bot and regular expressions if necessary. --><includeonly>{{Ability_(LW2) | s_image = | s_caption = | s_link = | s_name = | s_descr = | s_id = | s_templateName = {{subst:FULLPAGENAME}} | b_name = {{{ b_name | {{Ability (LW2)/Constants | b_NAME }} }}} | b_descr = {{{ b_descr | {{Ability (LW2)/Constants | b_DESCR }} }}} | b_info = {{{ b_info | {{Ability (LW2)/Constants | b_INFO }} }}} | b_table = {{{ b_table | {{Ability (LW2)/Constants | b_TABLE }} }}} }}</includeonly>
Parameters
s_image
: Image filename without link or prefix, but including extension, e.g. Image_name.jpg
. This get's expanded in the template to blahblah
s_caption
: Rollover text for the main image.
s_link
: Title of page on wiki or URL for the main image to link to. Do not use this to link to a template page! It should lead to a content page in the Main namespace. See s_templateName
below for that.
s_name
: The perk/ability name.
s_descr
: A (shortish) description of the perk.
s_id
: ID of HTML elements. This should contain no special characters, no spaces, and must be unique across the wiki for future compability. A good option is the ability's name suffixed with the game it belongs to, e.g. on the {{Aggression (LW2)}} template it would read aggressionLW
(yes, the beginning lowercase is intentional; please useCamelCase.)
s_templateName
: The base name of the ability template page, including namespace. E.g. for {{Aggression (LW2)}} this value will read Template:Aggression (LW2)
. The function in the skeleton will do this for you the first time the page is saved.
Passthroughs
This section of the skeleton should not be modified nor ommitted.
The calls to {{Ability (LW2)/Constants}} return default values to be used by all ability templates. This permits users to declare, or not, any of these parameters when calling a perk template, e.g. {{Aggression (LW2)}}. Doing so will override the default value.
b_name
: Set if name is visible. 0: Always invisible. 1: Always visible. Default: 0.
b_descr
: Set if description is visible. 0: Always invisible. 1: Always visible. Default: 0.
b_info
: Set if info icon is visible. 0: Always invisible. 1: Always visible. Default: 0.
b_table
: Set if extra padding should be added. This is intended for use in tables, such as {{Class Tree (LW2)}}. 0: Never have extra padding. 1: Always have extra padding. Default: 0.
Depreciated or Removed
s_info
: Removed 04-Feb-2017 . Was previously used to add info rollover text. This text has since been moved to the /Info subpage of each ability template. Superceded by s_templateName.
Bugs
None known.