Template:Item table: Difference between revisions
>AnnanFay (Added: Forced sorting by number for relevant columns (hope I didn't break anything!)) |
>AnnanFay m (broke something, trying to fix!) |
||
Line 2: | Line 2: | ||
! Name<!-- | ! Name<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | base }} | !! Base Item }}<!-- | -->{{#if: {{#pos: {{{format|}}} | base }} | !! Base Item }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | level }} | !data-sort-type="number"! {{abbr|[[File:Level_up_icon_small.png|link=|Lvl.]]|Required Level|class=nounderline}} }}<!-- | -->{{#if: {{#pos: {{{format|}}} | level }} | !!data-sort-type="number"{{!}} {{abbr|[[File:Level_up_icon_small.png|link=|Lvl.]]|Required Level|class=nounderline}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | str }} | !data-sort-type="number"! {{abbr|[[Image:StrengthIcon_small.png|link=|Str.]]|Required Strength|class=nounderline}} }}<!-- | -->{{#if: {{#pos: {{{format|}}} | str }} | !!data-sort-type="number"{{!}} {{abbr|[[Image:StrengthIcon_small.png|link=|Str.]]|Required Strength|class=nounderline}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | dex }} | !data-sort-type="number"! {{abbr|[[Image:DexterityIcon_small.png|link=|Dex.]]|Required Dexterity|class=nounderline}} }}<!-- | -->{{#if: {{#pos: {{{format|}}} | dex }} | !!data-sort-type="number"{{!}} {{abbr|[[Image:DexterityIcon_small.png|link=|Dex.]]|Required Dexterity|class=nounderline}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | int }} | !data-sort-type="number"! {{abbr|[[Image:IntelligenceIcon_small.png|link=|Int.]]|Required Intelligence|class=nounderline}} }}<!-- | -->{{#if: {{#pos: {{{format|}}} | int }} | !!data-sort-type="number"{{!}} {{abbr|[[Image:IntelligenceIcon_small.png|link=|Int.]]|Required Intelligence|class=nounderline}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | weapon }} | !data-sort-type="number"! Damage !data-sort-type="number"! Critical Strike Chance !data-sort-type="number"! Attacks per Second }}<!-- | -->{{#if: {{#pos: {{{format|}}} | weapon }} | !!data-sort-type="number"{{!}} Damage !!data-sort-type="number"{{!}} Critical Strike Chance !!data-sort-type="number"{{!}} Attacks per Second }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | armour }} | | -->{{#if: {{#pos: {{{format|}}} | armour }} | | ||
{{#if: {{#pos: {{{format|}}} | block }} | !data-sort-type="number"! Chance to Block }}<!-- | {{#if: {{#pos: {{{format|}}} | block }} | !!data-sort-type="number"{{!}} Chance to Block }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | str }} | !data-sort-type="number"! Armour Rating }}<!-- | -->{{#if: {{#pos: {{{format|}}} | str }} | !!data-sort-type="number"{{!}} Armour Rating }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | dex }} | !data-sort-type="number"! Evasion Rating }}<!-- | -->{{#if: {{#pos: {{{format|}}} | dex }} | !!data-sort-type="number"{{!}} Evasion Rating }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | int }} | !data-sort-type="number"! Energy Shield }} }}<!-- | -->{{#if: {{#pos: {{{format|}}} | int }} | !!data-sort-type="number"{{!}} Energy Shield }} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | flask }} | | -->{{#if: {{#pos: {{{format|}}} | flask }} | | ||
{{#if: {{#pos: {{{format|}}} | life }} | !data-sort-type="number"! {{abbr|Life|Life Recovered over Time per Sip}} !data-sort-type="number"! {{abbr|Time|Life Recovery Time in Seconds}} }}<!-- | {{#if: {{#pos: {{{format|}}} | life }} | !!data-sort-type="number"{{!}} {{abbr|Life|Life Recovered over Time per Sip}} !!data-sort-type="number"{{!}} {{abbr|Time|Life Recovery Time in Seconds}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | mana }} | !data-sort-type="number"! {{abbr|Mana|Mana Recovered over Time per Sip}} !data-sort-type="number"! {{abbr|Time|Mana Recovery Time in Seconds}} }}<!-- | -->{{#if: {{#pos: {{{format|}}} | mana }} | !!data-sort-type="number"{{!}} {{abbr|Mana|Mana Recovered over Time per Sip}} !!data-sort-type="number"{{!}} {{abbr|Time|Mana Recovery Time in Seconds}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | effects }} | !! class="unsortable" {{!}} Effects !! Duration }}<!-- | -->{{#if: {{#pos: {{{format|}}} | effects }} | !! class="unsortable" {{!}} Effects !! Duration }}<!-- | ||
-->!! {{abbr|Capacity|Total Amount of Charges the Flask Can Hold}} !! {{abbr|Usage|Amount of Charges Used per Sip}} }}<!-- | -->!! {{abbr|Capacity|Total Amount of Charges the Flask Can Hold}} !! {{abbr|Usage|Amount of Charges Used per Sip}} }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | map }} | !data-sort-type="number"! Map Level !data-sort-type="number"! Item Quantity }}<!-- | -->{{#if: {{#pos: {{{format|}}} | map }} | !!data-sort-type="number"{{!}} Map Level !!data-sort-type="number"{{!}} Item Quantity }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | currency }} | !data-sort-type="number"! Stack Size }}<!-- | -->{{#if: {{#pos: {{{format|}}} | currency }} | !!data-sort-type="number"{{!}} Stack Size }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | mods }} | !! class="unsortable" {{!}} Modifiers }}<!-- | -->{{#if: {{#pos: {{{format|}}} | mods }} | !! class="unsortable" {{!}} Modifiers }}<!-- | ||
-->{{#if: {{#pos: {{{format|}}} | flavour }} | !! class="unsortable" {{!}} Flavour Text }}<!-- | -->{{#if: {{#pos: {{{format|}}} | flavour }} | !! class="unsortable" {{!}} Flavour Text }}<!-- |
Revision as of 17:58, 1 May 2013
This template performs a Cargo query for items and returns the results as a formatted table.
Parameters
Query parameters
These parameters are used to construct the Cargo query. For more information about how these parameters should be used, see Extension:Cargo/Querying data.
Parameter | Value | Description | Required |
---|---|---|---|
where | str | The conditions that must be met for items to appear in the table. This is the main portion of the WHERE clause in the query. | |
tables | list[str] | A comma-separated list of any additional Cargo tables to select from, apart from those that are required based on the § Column display parameters. This corresponds to the FROM clause in the query. | |
join | list[str] | Specifies how the rows are combined from any additional Cargo tables given by |tables= . This corresponds to JOIN clauses in the query.
|
|
orderBy | list[str] | Fields to sort the results by, and in which order. This corresponds to the ORDER BY clause in the query. | |
limit | int | The maximum number of rows to return. This corresponds to the LIMIT clause in the query. | |
groupBy | list[str] | Additional fields to group rows by, secondary to items._pageID . This corresponds to the GROUP BY clause in the query.
|
|
having | list[str] | The conditions that must be met when grouping rows. This corresponds to the HAVING clause in the query. |
Table display parameters
Parameter | Value | Description | Required |
---|---|---|---|
default | str | If specified, the value of this will be returned of there are no results for the specified query. | |
large | bool | Whether to show large inventory icons
Default: No |
|
responsive | bool | Whether to collapse the table so that it takes up less space. Individual users have the option to turn this behavior off in their user preferences.
Default: No |
|
no_html | bool | Don't show HTML infoboxes on hover.
Advisable to enable this on very large lists, as it makes the resulting table much smaller. In particular if the page hits the wiki limits for size. |
Column display parameters
All these parameters are binary, so as long you specify something like icon=1
it will show up. If something is not available on the item you're fetching it will show up as "N/A"
Parameter | Description | Local |
---|---|---|
base_item | Shows the base item (i.e. of an unique item). | |
class | Show the item class. | |
rarity | Show the rarity of the item. | |
rarity_id | Show the rarity id of the item which is not dependent on the game language. | |
essence | Shows the essence tier. | |
drop_level | Shows the drop level of the item. | |
stack_size | Show the maximum stack size (not in currency tab). | |
stack_size_currency_tab | Show the maximum stack size in the currency tab. | |
level | the level requirement of the item. | |
str | the strength requirement of the item. | |
int | the intelligence requirement of the item. | |
dex | the dexterity requirement of the item. | |
ar | Shows how much armour the item provides. | |
ev | Shows how much evasion the item provides. | |
es | Shows how much energy shield the item provides. | |
wd | Shows how much ward the item provides. | |
block | Shows how much block the item provides. | |
damage | Shows the damage values of a weapon. This includes any added elemental or chaos damage in the appropriate colour(s). | |
aps | Shows the attacks per second value of a weapon. | |
crit | Shows the local critical strike chance of a weapon. | |
flask_life | Shows how much life the flask recovers per use. | |
flask_life_per_second | Shows how much life the flask recovers per second when in use. | |
flask_life_per_charge | Shows how much life the flask recovers per charge when used. | |
flask_mana | Shows how much mana the flask recovers per use. | |
flask_mana_per_second | Shows how much mana the flask recovers per second when in use. | |
flask_mana_per_charge | Shows how much mana the flask recovers per charge when used. | |
flask | Shows various generic flask properties:
|
|
buff | Shows the effect of the buffs granted by the item (generally applicable to Utility Flasks). | |
physical_dps | Shows physical damage per second. | |
fire_dps | Shows fire damage per second. | |
cold_dps | Shows cold damage per second. | |
lightning_dps | Shows lightning damage per second. | |
chaos_dps | Shows chaos damage per second. | |
elemental_dps | Shows the combined elemental damage per second (i.e. fire damage, cold damage and lightning damage). | |
poison_dps | Shows the combined damage that can apply to poison (i.e. physical damage and chaos damage). | |
dps | Shows the total combined damage per second (i.e. physical damage, fire damage, cold damage, lightning damage and chaos damage). | |
stat | the complete stat text of the item (both implicit and explicit stats derived from mods) in a single column. | |
item_limit | Shows the item limit of an item. | |
jewel_radius | Show the radius of a jewel. | |
map_tier | Show the map tier. | |
map_level | Show the map level. | |
map_guild_character | Show the character a map produces for a guild tag. | |
map_series | Show the name of the map series. | |
atlas_tier | Show the atlas tier based on the region upgrade level. | |
atlas_level | Show the atlas level based on the region upgrade level. | |
variations | Shows the number of possible variations of the doodad. | |
description | Shows the description text of the item. | |
flavour_text | Shows the flavour text of the item. | |
help_text | Shows the help_text of the item. | |
objective | Shows the objective section from a prophecy page crated with {{Prophecy description}} .
|
|
reward | Shows the reward section from a prophecy page crated with {{Prophecy description}} .
|
|
seal_cost | Shows the seal cost of a prophecy. | |
prediction_text | Shows the prediction text of a prophecy. | |
buff_icon | Shows the buff icon associated with the item's buff. | |
release_version | Shows which version the item was released. | |
removal_version | Shows which version the item was removed. | |
drop_enabled | Shows whether the item is considered drop_enabled and can be normally obtained. | |
drop_leagues | Shows which leagues the item can be obtained in. | |
drop_areas | Shows which areas the item can be obtained in. | |
drop_monsters | Shows which monsters the item can be obtained from. | |
drop_text | Shows drop restriction information that doesn't fit into other categories. | |
quest_name | Shows quest names that the item can be obtained from. | |
quest_act | Shows which act the quest can be found in. | |
purchase_cost | Shows the cost of buying from an NPC vendor. | |
sell_price | Shows the currencies received when selling the item to an NPC vendor. | |
boss_name | Shows the bosses of the map. | |
boss_number | Shows the number of bosses in the map. | |
legacy | Shows legacy stats where the data is queried from {{Legacy variant table row}} .
|
|
granted_skills | Shows skills granted by the item. | |
alternate_art | Shows the alternate arts the item may have. | |
seed_type | Shows the type of a Harvest Seed. | |
seed_tier | Shows the Harvest Seed's Tier. | |
seed_growth_cycles | Shows how many cycles a Harvest Seed needs to grow. | |
seed_consumed_primal_lifeforce_percentage | Show the percentage of Primal lifeforce consumed when a Harvest Seed is used. | |
seed_consumed_vivid_lifeforce_percentage | Show the percentage of Vivid lifeforce consumed when a Harvest Seed is used. | |
seed_consumed_wild_lifeforce_percentage | Show the percentage of Wild lifeforce consumed when a Harvest Seed is used. | |
seed_required_nearby_seed_amount | Shows how many nearby seeds are required to grow this seed, if any. | |
seed_required_nearby_seed_tier | Shows what tier any nearby seeds needed to growth this seed have to be | |
seed_effect | Shows the effect of the Harvest Seed |
Multi-column display parameters
These parameters will active multiple options at once. They should be used for "default" lists, as additional variables may be added over time:
Parameter | Description | Parameters activated |
---|---|---|
weapon | Show weapon information. |
|
prophecy | Show prophecy information. |
|
version | Enables all options relevant to versions. |
|
drop | Show information related on how an item is obtained. |
|
doodad | Enables all options relevant to hideout doodads. |
|
quest | Enables all options relevant to quests. |
|
price | Enables all options relevant to prices. |
|
boss | Enables all options relevant to bosses. |
|
seed | Enables all options relevant to Harvest Seeds. |
|
seed_consumed_lifeforce | Shows the percentage values of life force consumed for all three Harvest Seed types. |
|
seed_required_nearby_seeds | Shows the seed amount and tier required of nearby seeds |
|
Stat parameters
It is possible to directly query any stats on the item. The stats are an aggregate from all modifiers on the item (this means it will include implicit values).
Queried stats are sorted into columns, and a column can hold any arbitrary number of stats (but at least one) and there can be any number of columns.
The columns will be sorted by the average value of the stat. If multiple stats are specified for a single column, this is the average of all individual stat averages.
The following prefixes are used:
- Columns:
stat_column<i>_
- Stat:
stat<j>_
<i>
and <j>
need to be replaced with the number starting at 1.
Parameter | Value | Description | Required |
---|---|---|---|
stat_column<i>_header | str | Header to use in table for the stat.
If left empty, the id of stat will be used |
|
stat_column<i>_format | str | Lua string.format specifier. Note that the number of formatter must match the number of stats for the specific column or an error will be raised.
If left empty, all result will simply be shown in a comma-separated list. |
|
stat_column<i>_stat_format | str | Acceptable values:
|
|
stat_column<i>_order | int | Ordering priority for showing this column.
Defaults to a very high value. |
|
stat_column<i>_stat<j>_id | str | Identifier of the stat.
If you are not sure what this is, consider checking the sub objects created on items - it will be stored in Property:Has stat id |
Examples
Show item limit
{{Item table |where=items._pageName="Self-Flagellation" |large=1 |stat=1 |item_limit=1 }}
Yields:
Name
Show possible "Maximum Life" rolls on unique items with at least +100 life{{Item table |tables=item_stats |join=items._pageID=item_stats._pageID |where=items.rarity_id="unique" AND item_stats.id="base_maximum_life" AND item_stats.min > 100 |large=1 |level=1 |stat=1 |stat_column1_header=Life |stat_column1_format=+%s to maximum Life |stat_column1_stat1_id=base_maximum_life }} Yields:
|
---|