Help:Cargo template: Difference between revisions

Jump to navigation Jump to search
Line 37: Line 37:
=== Tips ===
=== Tips ===
* Choose a unique, descriptive table name (e.g., <code>Books</code>, not <code>Data</code>). Avoid using a field name as the table name to prevent query issues.
* Choose a unique, descriptive table name (e.g., <code>Books</code>, not <code>Data</code>). Avoid using a field name as the table name to prevent query issues.
* If your template adds data to an existing table (declared elsewhere), use <code>{{#cargo_attach:_table=ExistingTable}}</code> instead of <code>#cargo_declare</code>. This is useful when multiple templates feed one table.
* If your template adds data to an existing table (declared elsewhere), use <pre>{{#cargo_attach:_table=ExistingTable}}</pre> instead of <code>#cargo_declare</code>. This is useful when multiple templates feed one table.
* Changes to the declaration require recreating the table via <code>Special:CargoTables</code> (admin access may be needed).
* Changes to the declaration require recreating the table via <code>Special:CargoTables</code> (admin access may be needed).
* Keep fields minimal—only include what you’ll query later—to save space and improve performance.
* Keep fields minimal—only include what you’ll query later—to save space and improve performance.

Navigation menu