ICT:THE pattern
Appearance
ICT: Pattern — Dashboard, Page Form, Template, Cargo Table
This page documents the standard pattern for creating structured data modules in the Costa Sano Research Archive. It applies to all entities stored in Cargo tables (e.g., Chapters, Persons, Locations, Events, Assets).
The pattern consists of four coordinated components:
- Template — stores data and writes to Cargo
- Form — provides a clean, simple editing UI
- Dashboard — lists records and links to the form
- Cargo table — automatically created from the template declaration
This pattern is stable, reproducible, and successor‑friendly.
1. Template (Template:EntityName)
The template defines:
- the Cargo table structure (via
#cargo_declare) - how data is stored (via
#cargo_store) - the form association (via
#forminput:form=…) - the display of the page itself
Structure
<noinclude>
Documentation text…
{{#cargo_declare:
_table=TableName
|field1=String
|field2=Text
|field3=Date
|field4=Page
}}
{{#forminput:form=EntityName}}
</noinclude>
{{#cargo_store:
field1={{{field1|}}}
|field2={{{field2|}}}
|field3={{{field3|}}}
|field4={{{field4|}}}
}}
== {{{field1|}}} ==
Notes
- The
#forminput:form=EntityNameline is required so Page Forms knows which form edits pages using this template. - Only fields declared in
#cargo_declaremay be stored. - The template name must match the form’s
….
2. Form (Form:EntityName)
The form provides a clean, simple UI for creating and editing records. It must:
- include an
infoblock to hide clutter - include a
standard input|savebutton - wrap fields inside a
for templateblock
Structure
<noinclude>
Form for creating and editing EntityName pages.
</noinclude>
{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}
{{{for template|EntityName}}}
{| class="formtable"
! Field 1
| {{{field|field1|mandatory}}}
|-
! Field 2
| {{{field|field2|input type=textarea}}}
|-
! Field 3
| {{{field|field3|input type=datepicker}}}
|-
! Field 4
| {{{field|field4|input type=combobox|values from namespace=EntityName}}}
|}
{{{standard input|save}}}
{{{end template}}}
Notes
- The
infoblock must appear before thefor templateblock. - The
standard input|saveline is required; without it, Page Forms falls back to the MediaWiki editor footer. - The form name must match the template name.
3. Dashboard (Dashboard:EntityName)
The dashboard lists all records and provides a clean entry point to the form.
Structure
= EntityName Dashboard =
{| class="wikitable sortable"
! Field1 !! Field2 !! Field3
{{#cargo_query:
tables=TableName
|fields=_pageName,field1,field2,field3
|where=_pageNamespace=EntityNamespace
|order by=field1
|format=template
|template=EntityRow
|named args=yes
|cache=no
}}
|}
{{#forminput:
form=EntityName
|namespace=EntityName
|button text=➕ New EntityName
|returnto=Dashboard:EntityName
}}
Notes
- The dashboard never links to
action=edit. - All editing must go through Page Forms.
4. Row Template (Template:EntityRow)
This template defines how each row in the dashboard table is rendered.
Structure
<includeonly>
|-
| {{#formlink:form=EntityName
|target={{{_pageName}}}
|link text={{{field1}}}
|returnto=Dashboard:EntityName
}}
| {{{field2}}}
| {{{field3}}}
</includeonly>
Notes
- The first column is the clickable link that opens the form editor.
#formlinkensures the user always entersaction=formedit.
5. Workflow Summary
Creating a new record
- User clicks "New EntityName"
- URL:
Special:FormEdit/EntityName/EntityName:XYZ - Clean Page Forms UI appears
- Data is stored via
#cargo_store - Cargo table updates automatically
Editing an existing record
- User clicks the code in the dashboard
- URL:
EntityName:XYZ?action=formedit - Clean Page Forms UI appears
- Data updates in Cargo
No user ever sees the MediaWiki editor.
6. Rules for Reuse
To create a new module (e.g., Persons, Locations, Events):
- Copy the Template pattern → adjust fields
- Copy the Form pattern → adjust fields
- Copy the Dashboard pattern → adjust table and row template
- Create a Row template using
#formlink - Verify:
- Template name = Form name
- Cargo table name is unique
- Dashboard uses the correct namespace
- Form includes
standard input|save
This pattern is stable, reproducible, and successor‑friendly.