Help:Cargo: Difference between revisions

From Blooncyclopedia, the independent Bloons knowledge base
Jump to navigation Jump to search
Created page with "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. <!--==How to store data== ==How to query data==--> ==Navigation== {{blooncyclopedia nav}} Category:Wiki help"
 
No edit summary
Line 1: Line 1:
Blooncyclopedia uses '''[[mw:Extension:Cargo|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.
Blooncyclopedia uses '''[[mw:Extension:Cargo|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.


<!--==How to store data==
==Storing data==
==How to query data==-->
Storing data is done using the <code><nowiki>{{#cargo_store}}</nowiki></code> 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, {{temp|BTD6 upgrade info}} is an infobox template that both defines the <code>btd6_upgrades</code> cargo table and stores the info for all those upgrades using template parameters.
 
==Querying data==
Querying data is done using the <code><nowiki>{{#cargo_query}}</nowiki></code> 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.
<!-- yes this article is incomplete -->
==External links==
*[[mediawikiwiki:Extension:Cargo|More details about Cargo on the MediaWiki wiki]]
 
==Navigation==
==Navigation==
{{blooncyclopedia nav}}
{{blooncyclopedia nav}}
[[Category:Wiki help]]
[[Category:Wiki help]]

Revision as of 20:58, 26 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.