Difference between revisions of "Template:Resources nav/doc"

From Albion Online Wiki
Jump to: navigation, search
m (Improved syntax-doc for 'item' sub-template.)
m (Sectioning)
 
Line 1: Line 1:
;Description
+
==Description==
:This is a group of templates that work together to provide various navigation boxes related to [[resource|raw]] and [[refining|refined resources]] in the game using {{t|navbox}}.
+
This is a group of templates that work together to provide various navigation boxes related to [[resource|raw]] and [[refining|refined resources]] in the game using {{t|navbox}}.
:{{ombox
+
{{ombox
 
|type=notice
 
|type=notice
 
|text=These templates and their documentation is still a WIP version and will be completed soon.
 
|text=These templates and their documentation is still a WIP version and will be completed soon.
 
}}
 
}}
  
;Syntax
+
==Syntax==
:;Beware of white-space !
+
;Beware of white-space !
::No white-space allowed, see [[Template:Resources_nav/item/testcases|test cases]].
+
:No white-space allowed, see [[Template:Resources_nav/item/testcases|test cases]].
  
 
{{#switch: {{PAGENAME}}
 
{{#switch: {{PAGENAME}}
Line 14: Line 14:
 
<!-- Default syntax -->
 
<!-- Default syntax -->
 
| #default=
 
| #default=
:Type {{t|{{
+
Type {{t|{{
 
#ifeq: {{SUBPAGENAME}}|doc
 
#ifeq: {{SUBPAGENAME}}|doc
 
| {{#titleparts:{{PAGENAME}}|-1}}
 
| {{#titleparts:{{PAGENAME}}|-1}}
Line 24: Line 24:
 
<!-- Specific syntax for 'item' sub-template -->
 
<!-- Specific syntax for 'item' sub-template -->
 
| {{ROOTPAGENAME}}/item=
 
| {{ROOTPAGENAME}}/item=
:{{ombox
+
{{ombox
 
|type=content
 
|type=content
 
|textstyle=color:red;
 
|textstyle=color:red;
Line 33: Line 33:
 
These parameters are used for normal items, i just put them in the code of the template to make it usable for any item.
 
These parameters are used for normal items, i just put them in the code of the template to make it usable for any item.
 
}}
 
}}
:Type {{t|{{PAGENAME}}|named parameters{{=}}value|FULLPAGENAME|style=code}} somewhere.
+
Type {{t|{{PAGENAME}}|named parameters{{=}}value|FULLPAGENAME|style=code}} somewhere.
:*<i>unnamed parameters</i>:
+
*<i>unnamed parameters</i>:
:**<b>FULLPAGENAME</b> (Required, <b><u>1st unnamed parameter</u></b>)
+
**<b>FULLPAGENAME</b> (Required, <b><u>1st unnamed parameter</u></b>)
:**:The complete pagename of the resource to display and link to without namespace.
+
**:The complete pagename of the resource to display and link to without namespace.
:**:Eg. &ldquo;<i>Resource/Wood/Rough Logs</i>&rdquo;
+
**:Eg. &ldquo;<i>Resource/Wood/Rough Logs</i>&rdquo;
:**:Make sure there is no white-space after it, thus close the template call right after it to eliminate the trailing linefeed.
+
**:Make sure there is no white-space after it, thus close the template call right after it to eliminate the trailing linefeed.
 
<!-- -->
 
<!-- -->
:*<i>named parameters</i>:
+
*<i>named parameters</i>:
:**<b>l</b> or <b>layout</b> (Optional, case-insensitive)
+
**<b>l</b> or <b>layout</b> (Optional, case-insensitive)
:**:To have a horizontal/vertical layout.<br/>
+
**:To have a horizontal/vertical layout.<br/>
:**:One of these preset names, either first letter or full:
+
**:One of these preset names, either first letter or full:
:**:*<b><u>V</u>ertical</b> (Default)
+
**:*<b><u>V</u>ertical</b> (Default)
:**:*<b><u>H</u>orizontal</b>
+
**:*<b><u>H</u>orizontal</b>
 
<!-- -->
 
<!-- -->
:**<b>t</b> or <b>tier</b> (Optional, Integer or Roman uppercase)
+
**<b>t</b> or <b>tier</b> (Optional, Integer or Roman uppercase)
:**:The tier of the item, sets the background color to same as the tier indicator of the image. (Grey is used if not set)
+
**:The tier of the item, sets the background color to same as the tier indicator of the image. (Grey is used if not set)
:**:Valid values:
+
**:Valid values:
:**:*<b>1</b> &rArr; <b>8</b>
+
**:*<b>1</b> &rArr; <b>8</b>
:**:*<b>I</b> &rArr; <b>VIII</b>
+
**:*<b>I</b> &rArr; <b>VIII</b>
 
<!-- -->
 
<!-- -->
:**<b>s</b> or <b>size</b> (Optional, case-insensitive)
+
**<b>s</b> or <b>size</b> (Optional, case-insensitive)
:**:Size of the image.
+
**:Size of the image.
:**:One of these preset names, either first letter or full:
+
**:One of these preset names, either first letter or full:
:**:*<b><u>B</u>ig</b> (100px)
+
**:*<b><u>B</u>ig</b> (100px)
:**:*<b><u>N</u>ormal</b> (80px) (Default)
+
**:*<b><u>N</u>ormal</b> (80px) (Default)
:**:*<b><u>S</u>mall</b> or <b><u>I</u>nline</b> (48px)
+
**:*<b><u>S</u>mall</b> or <b><u>I</u>nline</b> (48px)
 
<!-- -->
 
<!-- -->
:**<b>q</b> or <b>quality</b> (Optional, Integer)
+
**<b>q</b> or <b>quality</b> (Optional, Integer)
:**:The item quality level.
+
**:The item quality level.
:**:Valid values:
+
**:Valid values:
:**:*<b>1</b> &rArr; <b>5</b>
+
**:*<b>1</b> &rArr; <b>5</b>
 
<!-- -->
 
<!-- -->
:**<b>e</b> or <b>enchantment</b> (Optional, Integer)
+
**<b>e</b> or <b>enchantment</b> (Optional, Integer)
:**:The item enchantment level.
+
**:The item enchantment level.
:**:Valid values:
+
**:Valid values:
:**:*<b>0</b> &rArr; <b>3</b>
+
**:*<b>0</b> &rArr; <b>3</b>
  
 
<!-- Specific syntax for 'data' sub-templates -->
 
<!-- Specific syntax for 'data' sub-templates -->
 
| {{#titleparts:{{PAGENAME}}|-1}}/data=
 
| {{#titleparts:{{PAGENAME}}|-1}}/data=
:Type {{t|{{PAGENAME}}|style=code}} as the value for the list parameter of {{t|navbox}}.
+
Type {{t|{{PAGENAME}}|style=code}} as the value for the list parameter of {{t|navbox}}.
  
 
}}
 
}}
  
;Dependencies
+
==Dependencies==
:It depends on the following sub-templates to display:
+
It depends on the following sub-templates to display:
:{| class="wikitable" style="white-space:nowrap;"
+
{| class="wikitable" style="white-space:nowrap;"
 
|+ Dependencies:
 
|+ Dependencies:
 
|- style="position:sticky; top:14ch;"
 
|- style="position:sticky; top:14ch;"

Latest revision as of 10:41, 4 May 2019

Description

This is a group of templates that work together to provide various navigation boxes related to raw and refined resources in the game using {{navbox}}.

Syntax

Beware of white-space !
No white-space allowed, see test cases.

Type {{Resources nav|state}} somewhere.

The initial state is collapsed and can be lifted by providing an empty frist argument.
You can also use other state´s as documented in mw:Manual:Collapsible elements.

Dependencies

It depends on the following sub-templates to display:

Dependencies:
Shortcut Actual template Explanation
Layout:
{{Resources nav/startdata}} The HTML to start the main flexbox.
(Needs to be closed with a </div>)
Single resource:
{{Resources nav/item}} Displays single entries inside the .../data templates.
Uses <aoitem> to display the image.
Makes use of CSS-Grid Technology.
Raw resource groups:
{{Resources nav/Raw}} Displays the groups below combined.
{{Wood Log nav}} {{Resources nav/Raw/Wood}} Displays all Wood Logs.
Uses {{Resources nav/Raw/Wood/data}}
{{Stone Rock nav}} {{Resources nav/Raw/Stone}} Displays all Stone Rocks.
Uses {{Resources nav/Raw/Stone/data}}
{{Fiber nav}} {{Resources nav/Raw/Fiber}} Displays all Fibers.
Uses {{Resources nav/Raw/Fiber/data}}
{{Hide nav}} {{Resources nav/Raw/Hide}} Displays all Hides.
Uses {{Resources nav/Raw/Hide/data}}
{{Ore nav}} {{Resources nav/Raw/Ore}} Displays all Ores.
Uses {{Resources nav/Raw/Ore/data}}
Refined resource groups:
{{Resources nav/Refined}} Displays the groups below combined.
{{Plank nav}} {{Resources nav/Refined/Wood}} Displays all Planks.
Uses {{Resources nav/Refined/Wood/data}}
{{Stone Block nav}} {{Resources nav/Refined/Stone}} Displays all Stone Blocks.
Uses {{Resources nav/Refined/Stone/data}}
{{Cloth nav}} {{Resources nav/Refined/Fiber}} Displays all Cloths.
Uses {{Resources nav/Refined/Fiber/data}}
{{Leather nav}} {{Resources nav/Refined/Hide}} Displays all Leathers.
Uses {{Resources nav/Refined/Hide/data}}
{{Metal Bar nav}} {{Resources nav/Refined/Ore}} Displays all Metal Bars.
Uses {{Resources nav/Refined/Ore/data}}
Combined groups:
{{Resources nav}} {{Resources nav/All}} Displays the groups below combined.
{{Wood nav}} {{Resources nav/Wood}} Displays all Wood Logs and Planks combined.
Uses both {{Resources nav/Raw/Wood/data}} and {{Resources nav/Refined/Wood/data}}.
{{Stone nav}} {{Resources nav/Stone}} Displays all Stone Rocks and Stone Blocks combined.
Uses both {{Resources nav/Raw/Stone/data}} and {{Resources nav/Refined/Stone/data}}.
{{Fibers nav}} {{Resources nav/Fiber}} Displays all Fibers and Cloths combined.
Uses both {{Resources nav/Raw/Fiber/data}} and {{Resources nav/Refined/Fiber/data}}.
{{Hides nav}} {{Resources nav/Hide}} Displays all Hides and Leathers combined.
Uses both {{Resources nav/Raw/Hide/data}} and {{Resources nav/Refined/Hide/data}}.
{{Ores nav}} {{Resources nav/Ore}} Displays all Ores and Metal Bars combined.
Uses both {{Resources nav/Raw/Ore/data}} and {{Resources nav/Refined/Ore/data}}.