Help:Cargo template: Difference between revisions

Jump to navigation Jump to search
(Created page with "= Understanding MediaWiki Cargo Templates = Cargo is a MediaWiki extension that lets you store structured data from wiki pages in database-like tables. This makes it easy to query and display data across your wiki. Templates are a key way to use Cargo, allowing editors to input data (like filling out a form) that gets saved and reused. A '''Cargo-enabled template''' has three main parts that work together to define, display, and store data: # '''The declaration part'''...")
 
Line 17: Line 17:


=== How It Works ===
=== How It Works ===
You use the parser function <code>{{#cargo_declare:}}</code> with parameters:
You use the parser function <pre>{{#cargo_declare:}}</pre> with parameters:
* The first parameter is always <code>_table=TableName</code> (replace <code>TableName</code> with something descriptive, like <code>Books</code>).
* The first parameter is always <code>_table=TableName</code> (replace <code>TableName</code> with something descriptive, like <code>Books</code>).
* Then, list each field as <code>|FieldName=Type (options)</code>. Common types include:
* Then, list each field as <code>|FieldName=Type (options)</code>. Common types include:

Navigation menu