Help:Cargo

From Blooncyclopedia, the independent Bloons knowledge base
Revision as of 00:24, 29 August 2024 by Polavux (talk | contribs) (Protected "Help:Cargo" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Jump to navigation Jump to search

Blooncyclopedia uses Cargo to keep track of data in templates. Using Cargo queries, data stored in the site's database can be re-used without having to copy and paste it manually, and if the data needs to be edited (due to a patch being released or a correction being made), every page querying that data is automatically updated.

Storing data

Storing data is done using the {{#cargo_store}} parser function within a template. This template also needs to either declare the cargo table it will store content into, or attach itself to a cargo table that's defined in another template. For example, {{BTD6 upgrade info}} is an infobox template that both defines the btd6_upgrades cargo table and stores the info for all those upgrades using template parameters.

Querying data

Querying data is done using the {{#cargo_query}} parser function. Unlike defining and storing data, queries do not have to be in a template, though it's good practice to wrap them around a template if they're going to be used more than once.