ICT:Cargo and PageForms
Appearance
Cargo and Page Forms Implementation Guide (2026)
This guide explains how to set up a structured data system using the Cargo and Page Forms extensions in MediaWiki 1.45.
1. The Data Schema (Template:Book)
The template is the "brain" of the operation. It declares the database structure and stores the data when a page is saved.
Path: Template:Book
<noinclude>
{{#cargo_declare:
_table = Books
|Title = String
|Author = String
|Year = Integer
}}
This template is used to store book metadata in the Cargo database.
</noinclude>
<includeonly>
{{#cargo_store:
_table = Books
}}
{| class="wikitable" style="width: 300px;"
! Title
| {{{Title|}}}
|-
! Author
| {{{Author|}}}
|-
! Year
| {{{Year|}}}
|}
[[Category:Books]]
</includeonly>
2. The Input Interface (Form:Book)
The form provides a user-friendly way to fill out the template without touching wikitext. It also enables autocompletion from existing Cargo data.
Path: Form:Book
{{{standard input|itemname|label=Book Page Title}}}
{{{for template|Book}}}
{| class="formtable"
! Book Title:
| {{{field|Title|mandatory}}}
|-
! Author:
| {{{field|Author|input type=combobox|cargo table=Books|cargo field=Author}}}
|-
! Publication Year:
| {{{field|Year|input type=number}}}
|}
{{{end template}}}
'''Summary of changes:'''
{{{standard input|summary}}}
{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|cancel}}}
3. Activation Steps
After saving the pages above, you MUST perform these steps to activate the database:
- Go to Template:Book.
- Click the "Create data table" (or "Recreate data") tab at the top.
- Click OK to initialize the SQL table.
- Go to and add Template:code to ensure the "Edit with form" button appears automatically.
4. Querying the Data
To display the data stored in your "Books" table on any other page, use a Cargo query:
{{#cargo_query:
|tables = Books
|fields = _pageName=Page, Title, Author, Year
|where = Year > 2000
|format = table
|display_columns = Page, Title, Author, Year
}}
Resources
- [www.mediawiki.org Cargo Storing Documentation]
- [www.mediawiki.org Page Forms Definition Guide]