Help:Cargo: Difference between revisions

From Blooncyclopedia, the independent Bloons knowledge base
Jump to navigation Jump to search
No edit summary
m Protected "Help:Cargo" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
(No difference)

Revision as of 00:24, 29 August 2024

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.