Template:Stormforged Cornerstones

From Against the Storm Official Wiki
Revision as of 01:58, 3 May 2024 by Aeredor (talk | contribs) (support for showing id and hiding description)

This is the Template Documentation from Template:Stormforged Cornerstones/doc.

Overview

Displays data about all Stormforged Cornerstones or a subset of them based on search parameters and exclusions. There are a few ways the data can be displayed. It is not possible to include regular (non-Stormforged) Cornerstones in the results.

Parameters

All parameters are optional. If no parameters are given, a table of all Stormforged Cornerstones will be displayed, showing their icon and name linking to the Cornerstone's page, descriptions, and prices.

Selection and Exclusion

You may combine the first four parameters to return more Cornerstones. The result will be the union of your selections, without duplicates. Then use exclude to remove any Cornerstones that are unrelated to your purposes with their ids.

Remember that ids are not visible in the game, so you may need to look them up.

Parameter Description
id A list of IDs of Stormforged Cornerstones, separated by commas. Since IDs are unique, each matched ID adds exactly one Cornerstone to the table. Will not throw an error if an ID is invalid.
name Searches names for this string, and adds Cornerstones with any part of their names matching that string to the table.
description Searches descriptions for this string, and adds Cornerstones with any part of their descriptions matching that string to the table.
upgrades_from_id The regular Cornerstone with this id may be upgraded into a Stormforged Cornerstone, which will be selected to display in the table. If there is a match, adds one Stormforged Cornerstone (not the regular version) with that id to the table, since ids are unique.
exclude A list of IDs, separated by commas, that will be excluded from the display. Will not throw an error if an ID is invalid.

Output Overrides

These parameters allow you to customize the appearance of the results.

Parameter Default Description
caption "Stormforged Cornerstones" If you want to override the default caption for the table, you can specify it here.
skip_prices not skipped Use skip_prices=skip if you want a table with fewer columns that only lists the icons, names, and their descriptions--without their prices at the Forsaken Altar. This breaks from the naming convention of the other parameters because the template logic is different.
show_id hidden Use show_id=show if you want to show a first column in the table that shows the id of the Cornerstone. (In list or inline display, the id is shown in parentheses.)
show_description shown Use show_description=no if you want to hide the description column from the table. (In list or inline display, the descriptions are never shown.)
show_regular hidden Use show_regular=show if you want to show a last column in the table that shows the regular version that each Cornerstone is upgraded from, if any. (In list or inline display, the regular versions are never shown.)
display a table For use when including these Cornerstones inside other tables or within paragraphs, the display parameter condenses the output to just the links to the pages on each Cornerstone:
  • Use display=list to convert the table layout into a basic list with simple links and no icons.
  • Use display=inline to convert the table into an inline list of links, also with no icons.
list_type bullet When displaying as a list instead of a table, you can specify list_type=number to show the list as a numbered list instead.

Errors

No results from search

If you specify parameters intending to select or search for terms, sometimes there is no result. This can be because you misspelled an id, asked for a search term that was not present in any name or description, or excluded every item that was found. In this situation, the template will instead render a plain-text message that nothing was found. (This is the error output regardless of any display overrides.)

{{Stormforged Cornerstones
|id=There is no ID like this
}}

Yields: No matching Stormforged Cornerstones found.

Table Examples

Selecting Cornerstones by their IDs

{{Stormforged Cornerstones
|id=[Altar] Fedora Hat
}}

Yields:

1 Stormforged Cornerstones with ID '[Altar] Fedora Hat'
Name Price Price when upgrading
meta resources villagers meta resources villagers
Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0



{{Stormforged Cornerstones
|id=[Altar] Fedora Hat, [Altar] Alarm Bells
}}

Yields:

2 Stormforged Cornerstones with selected IDs
Name Price Price when upgrading
meta resources villagers meta resources villagers
Alarm Bells (Stormforged) Alarm Bells (Stormforged) 48 2 48 0
Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0


Selecting by upgrade

Note that the regular versions must be shown to see them in the table. Selecting by the upgrade does not automatically show the extra column in the table.

{{Stormforged Cornerstones
|upgrades_from_id=Fedora Hat
}}

Yields:

1 Stormforged Cornerstones upgraded from 'Fedora Hat'
Name Price Price when upgrading
meta resources villagers meta resources villagers
Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0


Searching names and descriptions

The following example shows searching the same term in both name and description, but you could use either.

{{Stormforged Cornerstones
|name=trade
|description=trade
}}

Yields:

5 Stormforged Cornerstones named 'trade' and mentioning 'trade'
Name Price Price when upgrading
meta resources villagers meta resources villagers
Export Contract (Stormforged) Export Contract (Stormforged) 40 2 40 0
Stormwalker Training (Stormforged) Stormwalker Training (Stormforged) 40 2 40 0
Tightened Belt (Stormforged) Tightened Belt (Stormforged) 40 2 40 0
Trade Logs (Stormforged) Trade Logs (Stormforged) 40 2 40 0
Trade Negotiations (Stormforged) Trade Negotiations (Stormforged) 40 2 40 0


Skipping Price Columns

Compare the following table with the one above.

{{Stormforged Cornerstones
|name=trade
|description=trade
|skip_prices=skip
}}

Yields:

5 Stormforged Cornerstones named 'trade' and mentioning 'trade'
Name


Export Contract (Stormforged) Export Contract (Stormforged)


Stormwalker Training (Stormforged) Stormwalker Training (Stormforged)


Tightened Belt (Stormforged) Tightened Belt (Stormforged)


Trade Logs (Stormforged) Trade Logs (Stormforged)


Trade Negotiations (Stormforged) Trade Negotiations (Stormforged)


Showing Cornerstone IDs

{{Stormforged Cornerstones
|upgrades_from_id=Fedora Hat
|show_id=show
}}

Yields:

1 Stormforged Cornerstones upgraded from 'Fedora Hat'
ID Name Price Price when upgrading
meta resources villagers meta resources villagers
'[Altar] Fedora Hat' Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0


Hiding descriptions

{{Stormforged Cornerstones
|upgrades_from_id=Fedora Hat
|show_description=no
}}

Yields:

1 Stormforged Cornerstones upgraded from 'Fedora Hat'
Name Price Price when upgrading
meta resources villagers meta resources villagers
Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0


Showing regular versions

{{Stormforged Cornerstones
|upgrades_from_id=Fedora Hat
|show_regular=show
}}

Yields:

1 Stormforged Cornerstones upgraded from 'Fedora Hat'
Name Price Price when upgrading Upgrades from
meta resources villagers meta resources villagers
Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0 Old Fedora Hat Old Fedora Hat

Custom caption

{{Stormforged Cornerstones
|caption=Every Stormforged Cornerstone in the game
}}

Yields:

Every Stormforged Cornerstone in the game
Name Price Price when upgrading
meta resources villagers meta resources villagers
Advanced Fuel (Stormforged) Advanced Fuel (Stormforged) 40 2 40 0
Alarm Bells (Stormforged) Alarm Bells (Stormforged) 48 2 48 0
Ancient Pact (Stormforged) Ancient Pact (Stormforged) 40 2 40 0
Back to Nature (Stormforged) Back to Nature (Stormforged) 48 2 48 0
Blood Price Contract (Stormforged) Blood Price Contract (Stormforged) 20 3 20 2
Bone Tools (Stormforged) Bone Tools (Stormforged) 40 2 40 0
Cannibalism (Stormforged) Cannibalism (Stormforged) 20 3 20 2
Crowded Caravan (Stormforged) Crowded Caravan (Stormforged) 40 2 40 0
Crowded Houses (Stormforged) Crowded Houses (Stormforged) 40 2 40 0
Export Contract (Stormforged) Export Contract (Stormforged) 40 2 40 0
Export Specialization (Stormforged) Export Specialization (Stormforged) 40 2 40 0
Firekeeper's Prayer (Stormforged) Firekeeper's Prayer (Stormforged) 48 2 48 0
Firelink Ritual (Stormforged) Firelink Ritual (Stormforged) 48 2 48 0
Flame Amulets (Stormforged) Flame Amulets (Stormforged) 40 2 40 0
Forbidden Seal Shard (Stormforged) Forbidden Seal Shard (Stormforged) 48 2 48 0
Force of Nature (Stormforged) Force of Nature (Stormforged) 40 2 40 0
Forge Trip Hammer (Stormforged) Forge Trip Hammer (Stormforged) 40 2 40 0
Forsaken Seal (Stormforged) Forsaken Seal (Stormforged) 40 2 40 0
Generous Gifts (Stormforged) Generous Gifts (Stormforged) 40 2 40 0
Generous Rations (Stormforged) Generous Rations (Stormforged) 50 2 50 0
Hidden Reward (Stormforged) Hidden Reward (Stormforged) 40 2 40 0
Hidden from the Queen (Stormforged) Hidden from the Queen (Stormforged) 48 2 48 0
Hunter-Gatherers (Stormforged) Hunter-Gatherers (Stormforged) 48 2 48 0
Improvised Tools (Stormforged) Improvised Tools (Stormforged) 40 2 40 0
Lost in the Wilds (Stormforged) Lost in the Wilds (Stormforged) 50 2 50 0
Metallurgic Proficiency (Stormforged) Metallurgic Proficiency (Stormforged) 40 2 40 0
Mushroom Seedlings (Stormforged) Mushroom Seedlings (Stormforged) 40 2 40 0
No Quality Control (Stormforged) No Quality Control (Stormforged) 48 2 48 0
Old Fedora Hat (Stormforged) Old Fedora Hat (Stormforged) 48 2 48 0
Prayer Book (Stormforged) Prayer Book (Stormforged) 40 2 40 0
Rebellious Spirit (Stormforged) Rebellious Spirit (Stormforged) 50 2 50 0
Secret Techniques of the Firekeeper (Stormforged) Secret Techniques of the Firekeeper (Stormforged) 40 2 40 0
Secure Trail (Stormforged) Secure Trail (Stormforged) 48 2 48 0
Stormwalker Training (Stormforged) Stormwalker Training (Stormforged) 40 2 40 0
Summoned Smuggler (Stormforged) Summoned Smuggler (Stormforged) 60 3 60 0
Survivor Bonding (Stormforged) Survivor Bonding (Stormforged) 48 2 48 0
Tightened Belt (Stormforged) Tightened Belt (Stormforged) 40 2 40 0
Trade Logs (Stormforged) Trade Logs (Stormforged) 40 2 40 0
Trade Negotiations (Stormforged) Trade Negotiations (Stormforged) 40 2 40 0
Woodpecker Technique (Stormforged) Woodpecker Technique (Stormforged) 48 2 48 0


List Examples

Bulleted

This example reproduces the table above, when searching by name and description, in a list format.

{{Stormforged Cornerstones
|name=trade
|description=trade
|display=list
}}

Yields:

Numbered

{{Stormforged Cornerstones
|name=trade
|description=trade
|display=list
|list_type=number
}}

Yields:

  1. Export Contract (Stormforged)
  2. Stormwalker Training (Stormforged)
  3. Tightened Belt (Stormforged)
  4. Trade Logs (Stormforged)
  5. Trade Negotiations (Stormforged)

List with IDs

{{Stormforged Cornerstones
|name=trade
|description=trade
|display=list
|show_id=show
}}

Yields:

Inline Examples

{{Stormforged Cornerstones|name=trade|description=trade|display=inline}}

Yields the following, shown in the middle of a paragraph to highlight its usefulness. When you have a settlement profiting significantly from trading, consider investing in Export Contract (Stormforged), Stormwalker Training (Stormforged), Tightened Belt (Stormforged), Trade Logs (Stormforged), Trade Negotiations (Stormforged) Stormforged Cornerstones. If you can spare the cost, they can save your settlement!

{{Stormforged Cornerstones|upgrades_from_id=Alarm Bells|display=inline|show_id=show}}

Yields the ability to write a reminder that you can upgrade Alarm Bells to Alarm Bells (Stormforged) ('[Altar] Alarm Bells'), while only having to look up one ID!

View templates

This functionality is accomplished through the Wiki_data_model. This Template:Stormforged Cornerstones calls the controller module, which in turn interfaces with the data model modules. The view is handled entirely by these additional templates:

Related templates
Template Purpose
Template:StormforgedCornerstonesTable Primary, default table header template
Template:StormforgedCornerstonesTable/row Default table row template
Template:StormforgedCornerstonesTable/end Table markup closing
Template:StormforgedCornerstonesTable/SkipPrices Table header template, but without the prices columns
Template:StormforgedCornerstonesTable/row/SkipPrices Table row template, but without the prices columns
Template:StormforgedCornerstonesList/item List version row template (there is no list header template)