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

From Albion Online Wiki
Jump to: navigation, search
m (Extra notice about white-space)
m (Improved syntax-doc for 'item' sub-template.)
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}}.
:These templates and the documentation is still a WIP version and will be completed soon.
+
:{{ombox
 +
|type=notice
 +
|text=These templates and their documentation is still a WIP version and will be completed soon.
 +
}}
  
 
;Syntax
 
;Syntax
 +
:;Beware of white-space !
 +
::No white-space allowed, see [[Template:Resources_nav/item/testcases|test cases]].
 +
 
{{#switch: {{PAGENAME}}
 
{{#switch: {{PAGENAME}}
  
 +
<!-- Default syntax -->
 
| #default=
 
| #default=
 
:Type {{t|{{
 
:Type {{t|{{
Line 15: Line 22:
 
:You can also use other '''state'''&acute;s as documented in [[mw:Manual:Collapsible elements]].
 
:You can also use other '''state'''&acute;s as documented in [[mw:Manual:Collapsible elements]].
  
 +
<!-- Specific syntax for 'item' sub-template -->
 
| {{ROOTPAGENAME}}/item=
 
| {{ROOTPAGENAME}}/item=
:Type {{t|{{PAGENAME}}|FULLPAGENAME|style=code}} somewhere.
+
:{{ombox
:Where ''FULLPAGENAME'' is the complete pagename of the resource to display and link to.
+
|type=content
:Eg. &ldquo;Resource/Wood/Rough Logs&rdquo;
+
|textstyle=color:red;
 +
|text=Important note:
 +
For [[Resources]] you can't use the '''quality''' and '''enchantment''' parameters, you need to provide the complete name instead.<br/>
 +
Eg. Use &ldquo;Uncommon Pine Planks&rdquo; instead of &ldquo;Pine Planks&rdquo; (with enhancement level 1).<br/>
 +
See [[Planks#List_of_Planks_.26_Wood_Refining_Recipes|List of Planks & Wood Refining Recipes]] as example.<br/>
 +
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.
 +
:*<i>unnamed parameters</i>:
 +
:**<b>FULLPAGENAME</b> (Required, <b><u>1st unnamed parameter</u></b>)
 +
:**:The complete pagename of the resource to display and link to without namespace.
 +
:**: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.
 +
<!-- -->
 +
:*<i>named parameters</i>:
 +
:**<b>l</b> or <b>layout</b> (Optional, case-insensitive)
 +
:**:To have a horizontal/vertical layout.<br/>
 +
:**:One of these preset names, either first letter or full:
 +
:**:*<b><u>V</u>ertical</b> (Default)
 +
:**:*<b><u>H</u>orizontal</b>
 +
<!-- -->
 +
:**<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)
 +
:**:Valid values:
 +
:**:*<b>1</b> &rArr; <b>8</b>
 +
:**:*<b>I</b> &rArr; <b>VIII</b>
 +
<!-- -->
 +
:**<b>s</b> or <b>size</b> (Optional, case-insensitive)
 +
:**:Size of the image.
 +
:**:One of these preset names, either first letter or full:
 +
:**:*<b><u>B</u>ig</b> (100px)
 +
:**:*<b><u>N</u>ormal</b> (80px) (Default)
 +
:**:*<b><u>S</u>mall</b> or <b><u>I</u>nline</b> (48px)
 +
<!-- -->
 +
:**<b>q</b> or <b>quality</b> (Optional, Integer)
 +
:**:The item quality level.
 +
:**:Valid values:
 +
:**:*<b>1</b> &rArr; <b>5</b>
 +
<!-- -->
 +
:**<b>e</b> or <b>enchantment</b> (Optional, Integer)
 +
:**:The item enchantment level.
 +
:**:Valid values:
 +
:**:*<b>0</b> &rArr; <b>3</b>
  
 +
<!-- 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}}.
  
 
}}
 
}}
:;Beware of white-space !
 
::No white-space allowed, not even after parameter values, see [[Template:Resources_nav/item/testcases|test cases]]
 
  
 
;Dependencies
 
;Dependencies
Line 48: Line 97:
 
|
 
|
 
| {{t|{{ROOTPAGENAME}}/item}}
 
| {{t|{{ROOTPAGENAME}}/item}}
| Displays single entries inside the <b><i>.../data</i></b> templates.<br/>Uses <code><nowiki><aoitem></nowiki></code> to display the image.
+
| Displays single entries inside the <b><i>.../data</i></b> templates.<br/>Uses <code><nowiki><aoitem></nowiki></code> to display the image.<br/>Makes use of [https://developer.mozilla.org/en-US/docs/Web/CSS/grid CSS-Grid] Technology.
  
 
|-
 
|-

Revision as of 08:02, 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}}.