User:Pumbloom44/Cargo

=Guide to using the Cargo extension= This wiki uses Cargo in a number of templates to save and produce data regarding items and recipes. The aim of this extension is to make it easier to update this data by having a single location where the data is stored, and then automatically updating all pages that use the data based on this. Unfortunately this can make it confusing to see where wrong recipes/item information is coming from, so I have created this guide to hopefully make this more clear.

Storing Data
Recipes and items are stored to the cargo table using Template:Item_infobox and Template:recipe_store. This is like adding a row onto the end of an excel spreadsheet. Editing the variables you enter into these templates will edit the data that is stored in the cargo table. Our convention is to store the recipe on the page of the first output of the recipe only, for example Pumpkin=Raw Pumpkin + Pumpkin seeds is stored at Raw Pumpkin.

Item_infobox's main function besides displaying the infobox is to store item data, but it can also optionally be used to store recipes. The only time Template:recipe_store is mandatory is for items that can be crafted in multiple ways.

When you are storing something with ether of these templates you might not see the data from these rows shown straight away, as Cargo cannot see new data until the page is saved.

Displaying Data
The power of using these cargo tables is that once the items and recipes have been added to the database, other pages can then query the database to automatically generate results. This can be done ether by directly querying the table using #cargo_query, or by using a number of templates created for this purpose.

Recipe Show
Displays all stored recipes that produce this item

Recipe used in
Displays all stored recipes that use this item as a crafting ingredient

Recipe used in/table
Outputs as a table

Recipe crafted at
Displays all stored recipes that are crafted at this structure, or use this tool

Fixing a broken recipe or item
If you've spotted a recipe that's not working right the first step is to see if the wiki just hasn't seen that someone has fixed the page, by selecting "Purge Cache" or by editing and saving with no changes you can update any cargo queries on that page. The next step is to go to the page the recipe is stored at and making sure the recipe has been input correctly. If the recipe is not stored on the page of