Template:WeaponsTable: Difference between revisions
imported>Aramachus m changed inclusion of horizon changes box to section to distinguish unknown from no changes |
imported>Aramachus added level range parameter, documentation for it and the gear-table color class unless overwritten by the cssclasses parameter |
||
| Line 14: | Line 14: | ||
|title = {{{title6|}}} |
|title = {{{title6|}}} |
||
|count = {{{count|}}} |
|count = {{{count|}}} |
||
|include={{#if:{{{tooltip|}}}|{Item Statistics¦Item_Tooltip.dpl}|{Item Statistics}:[[%PAGE%|%TITLE%]]}},{Item Statistics¦WeaponsTable.dpl},##Horizon Changes.* |
|include={{#if:{{{levelrange|}}}|{Item Statistics}.hidebylevel¦phantom_arg={{{levelrange}}},}}{{#if:{{{tooltip|}}}|{Item Statistics¦Item_Tooltip.dpl}|{Item Statistics}:[[%PAGE%|%TITLE%]]}},{Item Statistics¦WeaponsTable.dpl},##Horizon Changes.* |
||
|includematch = {{#if:{{{job|}}}|/jobs\s*=.*\[\[{{{job}}}\]\].*¦jobs\s*=\s*All\sJobs\s*¦(?s)^((?!jobs).)*$/|/.*/}} |
|includematch = {{#if:{{{job|}}}|/jobs\s*=.*\[\[{{{job}}}\]\].*¦jobs\s*=\s*All\sJobs\s*¦(?s)^((?!jobs).)*$/|/.*/}} |
||
|table=class="horizon-table {{{cssclasses|}}} sortable",-,Name,Level,Damage,Delay,DPS,Jobs,Stats,Horizon Changes {{changes}} |
|table=class="horizon-table {{{cssclasses|gear-table}}} sortable",-,Name,Level,Damage,Delay,DPS,Jobs,Stats,Horizon Changes {{changes}} |
||
|tablesortcol=2 |
|tablesortcol={{#if:{{{levelrange|}}}|3|2}} |
||
}}{{#if:{{{collapse|}}}|</div><br>}}<!-- |
}}{{#if:{{{collapse|}}}|</div><br>}}<!-- |
||
--></onlyinclude></includeonly> |
--></onlyinclude></includeonly> |
||
| Line 24: | Line 24: | ||
Syntax: |
Syntax: |
||
<pre>{{WeaponsTable|cat1|...|notcat1|...|title1|...|job|collapse|cssclasses|tooltip|count}}</pre> |
<pre>{{WeaponsTable|cat1|...|notcat1|...|title1|...|job|levelrange|collapse|cssclasses|tooltip|count}}</pre> |
||
*Use cat1, cat2, cat3 to include required categories |
*Use cat1, cat2, cat3 to include required categories |
||
| Line 31: | Line 31: | ||
*Use title1, title2, ..., title6 to include specific pages |
*Use title1, title2, ..., title6 to include specific pages |
||
*Use job to include only gear by job XXX |
*Use job to include only gear by job XXX |
||
*Use levelrange to include gear in a given level range. Use a minus to separate min and max level like: ''30-40'' |
|||
*Use collapse to make the table collapsible. collapse=collapsed makes it collapsed by default. collapse=expand to make it expanded by default. (collapsed is also the default when entering anything else for the collapse parameter). |
*Use collapse to make the table collapsible. collapse=collapsed makes it collapsed by default. collapse=expand to make it expanded by default. (collapsed is also the default when entering anything else for the collapse parameter). |
||
*cssclasses can be used to add additional classes to the table. The most common usage here is add a color class to the table. |
*cssclasses can be used to add additional classes to the table. The most common usage here is add a color class to the table. |
||
| Line 46: | Line 47: | ||
<pre>{{WeaponsTable|cat1=Artifact Weapons}}</pre> |
<pre>{{WeaponsTable|cat1=Artifact Weapons}}</pre> |
||
Will |
Will return all weapons of category "Artifact Weapons". |
||
{{WeaponsTable|cat1=Artifact Weapons|count=5}} |
{{WeaponsTable|cat1=Artifact Weapons|count=5}} |
||
| Line 54: | Line 55: | ||
<pre>{{WeaponsTable|cat1=Artifact Weapons|tooltip=true|job=WHM}}</pre> |
<pre>{{WeaponsTable|cat1=Artifact Weapons|tooltip=true|job=WHM}}</pre> |
||
Will |
Will return all weapons which are categorized as "Artifact Weapons" and have "WHM" (or "all") in their job list. So this will return the WHM AF Weapon only. |
||
{{WeaponsTable|cat1=Artifact Weapons|tooltip=true|job=WHM}} |
{{WeaponsTable|cat1=Artifact Weapons|tooltip=true|job=WHM}} |
||
===Example 3=== |
|||
Syntax: |
|||
<pre>{{WeaponsTable|cat1=Staves|job=BLM|levelrange=68-74}}</pre> |
|||
Will return all staves in the level range 68-74 which can be equipped by a Black Mage. |
|||
{{WeaponsTable|cat1=Staves|job=BLM|levelrange=68-74}} |
|||
Revision as of 14:59, 13 November 2024
Usage
Wrapper Template to generate lists of weapons based on categories.
Syntax:
{{WeaponsTable|cat1|...|notcat1|...|title1|...|job|levelrange|collapse|cssclasses|tooltip|count}}
- Use cat1, cat2, cat3 to include required categories
- (note: you can use {{!}} to use a logical OR in a category)
- Use notcat1, notcat2, notcat2 to exclude categories
- Use title1, title2, ..., title6 to include specific pages
- Use job to include only gear by job XXX
- Use levelrange to include gear in a given level range. Use a minus to separate min and max level like: 30-40
- Use collapse to make the table collapsible. collapse=collapsed makes it collapsed by default. collapse=expand to make it expanded by default. (collapsed is also the default when entering anything else for the collapse parameter).
- cssclasses can be used to add additional classes to the table. The most common usage here is add a color class to the table.
- use the tooltip parameter to display image tooltips when hovering over the item names. Set to anything to enable, e.g. tooltip=true.
- (The count parameter is mainly used for testing)
- Also: count does not work with job parameter since the job parameter seems to filter after generating the list and after the count parameter cropped the list.
Examples
Some Example tables have been limited to output only 5 items (through the optional parameter count=5) because they serve only as examples. The syntax shown in the examples would generate the full tables.
See also Template:ArmorTable for example syntax
Example 1
Syntax:
{{WeaponsTable|cat1=Artifact Weapons}}
Will return all weapons of category "Artifact Weapons".
Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:WeaponsTable: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'cl1.cl_to' in 'ON' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:WeaponsTable Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Artifact_Weapons'))) WHERE p.page_is_redirect = 0 LIMIT 5 </code>
Example 2
Syntax:
{{WeaponsTable|cat1=Artifact Weapons|tooltip=true|job=WHM}}
Will return all weapons which are categorized as "Artifact Weapons" and have "WHM" (or "all") in their job list. So this will return the WHM AF Weapon only.
Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:WeaponsTable: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'cl1.cl_to' in 'ON' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:WeaponsTable Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Artifact_Weapons'))) WHERE p.page_is_redirect = 0 LIMIT 500 </code>
Example 3
Syntax:
{{WeaponsTable|cat1=Staves|job=BLM|levelrange=68-74}}
Will return all staves in the level range 68-74 which can be equipped by a Black Mage.
Extension:DynamicPageList4 (DPL4), version 4.0.0: Error: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:WeaponsTable: The DynamicPageList4 extension (version 4.0.0) produced a SQL statement which led to a Database error.<br/>The reason may be an internal error of DynamicPageList4 or an error that you made; especially when using parameters like 'categoryregexp' or 'titleregexp'. Usage of non-greedy <code>*?</code> matching patterns are not supported.<br/>The error message was:<br/><code>Error 1054: Unknown column 'cl1.cl_to' in 'ON' Function: MediaWiki\Extension\DynamicPageList4\Query::buildAndSelect - Template:WeaponsTable Query: SET STATEMENT max_statement_time=10 FOR SELECT DISTINCT p.page_namespace AS `page_namespace`,p.page_id AS `page_id`,p.page_title AS `page_title` FROM `page` `p` JOIN `categorylinks` `cl1` ON (((p.page_id = cl1.cl_from) AND (cl1.cl_to = 'Staves'))) WHERE p.page_is_redirect = 0 LIMIT 500 </code>