ICT:Cargo-Workflow: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
== 1) LocalSettings.php configuration == | == 1) LocalSettings.php configuration == | ||
<pre> | |||
# Cargo extension | # Cargo extension | ||
$wgCargoDBtype = "mysql"; | $wgCargoDBtype = "mysql"; | ||
| Line 21: | Line 21: | ||
wfLoadExtension( 'PageForms' ); | wfLoadExtension( 'PageForms' ); | ||
$wgPageFormsUploadableFiles = true; | $wgPageFormsUploadableFiles = true; | ||
</pre | </pre> | ||
'''Important:''' | '''Important:''' | ||
| Line 30: | Line 30: | ||
== 2) Template:Item == | == 2) Template:Item == | ||
This template defines the Cargo table and how each item page displays. | |||
<pre> | |||
<includeonly> | |||
{{#cargo_declare: | {{#cargo_declare: | ||
_table=Items, | _table=Items, | ||
| Line 41: | Line 43: | ||
'''Image:''' [[File:{{{Image}}}|400px]] | '''Image:''' [[File:{{{Image}}}|400px]] | ||
</includeonly> | |||
</pre | </pre> | ||
Notes: | Notes: | ||
* Only the | * Only the <includeonly> section is used by Cargo and PageForms. | ||
* The Image field must be declared as File. | * The Image field must be declared as File. | ||
| Line 52: | Line 54: | ||
== 3) Form:Item == | == 3) Form:Item == | ||
This is the form used to create new items. | |||
<pre> | |||
{{{info|page name=Item_<unique number>}}} | {{{info|page name=Item_<unique number>}}} | ||
{{{for template|Item}}} | {{{for template|Item}}} | ||
| Line 66: | Line 70: | ||
{{{standard input|save}}} | {{{standard input|save}}} | ||
{{{standard input|cancel}}} | {{{standard input|cancel}}} | ||
</pre | </pre> | ||
Key points: | Key points: | ||
| Line 77: | Line 81: | ||
== 4) AddItem page == | == 4) AddItem page == | ||
This page provides a simple button for club members to add new items. | |||
<pre> | |||
== Add a new item == | == Add a new item == | ||
| Line 83: | Line 89: | ||
{{#formlink:form=Item|link text=➕ Add a new item|link type=button}} | {{#formlink:form=Item|link text=➕ Add a new item|link type=button}} | ||
</pre> | </pre> | ||
Users never see Special:FormStart and never choose page names. | |||
---- | ---- | ||
| Line 89: | Line 97: | ||
== 5) BrowseItems page == | == 5) BrowseItems page == | ||
This page shows all items in a gallery. | |||
<pre> | |||
== Browse Items == | == Browse Items == | ||
| Line 98: | Line 108: | ||
|image size=200 | |image size=200 | ||
}} | }} | ||
</pre> | </pre> | ||
Notes: | |||
* tables=Items must be on its own line. | |||
* All other parameters start with |. | |||
* Produces a clickable gallery of all postcards. | |||
---- | ---- | ||
| Line 111: | Line 126: | ||
# Save | # Save | ||
# The item appears automatically in '''Browse Items''' | # The item appears automatically in '''Browse Items''' | ||
No technical knowledge required. | |||
---- | ---- | ||
Latest revision as of 11:36, 5 January 2026
ICT:Cargo-Workflow – Final Working Configuration (Cargo + PageForms)
This page documents the final, stable configuration for the postcard archive using Cargo and PageForms. It contains the complete working setup in one place, ready for successors.
1) LocalSettings.php configuration
# Cargo extension $wgCargoDBtype = "mysql"; $wgCargoDBserver = "10.10.10.2"; $wgCargoDBname = "cargodb"; $wgCargoDBuser = "cargouser"; $wgCargoDBpassword = "Mhv+mak!90"; $wgCargoDBprefix = ""; $wgCargo24HourTime = true; wfLoadExtension( 'Cargo' ); # PageForms extension wfLoadExtension( 'PageForms' ); $wgPageFormsUploadableFiles = true;
Important: $wgPageFormsUploadableFiles = true; must appear after wfLoadExtension( 'PageForms' ).
2) Template:Item
This template defines the Cargo table and how each item page displays.
<includeonly>
{{#cargo_declare:
_table=Items,
Title=String,
Image=File
}}
'''Title:''' {{{Title}}}
'''Image:''' [[File:{{{Image}}}|400px]]
</includeonly>
Notes:
- Only the <includeonly> section is used by Cargo and PageForms.
- The Image field must be declared as File.
3) Form:Item
This is the form used to create new items.
{{{info|page name=Item_<unique number>}}}
{{{for template|Item}}}
;Title
:{{{field|Title}}}
;Image
:{{{field|Image|input type=upload|uploadable}}}
{{{end template}}}
{{{standard input|save}}}
{{{standard input|cancel}}}
Key points:
- The info directive must be the first line (no blank lines above it).
- input type=upload|uploadable enables the upload widget.
- Page names are automatically generated: Item_0001, Item_0002, …
4) AddItem page
This page provides a simple button for club members to add new items.
== Add a new item ==
Click the button below to add a new item.
{{#formlink:form=Item|link text=➕ Add a new item|link type=button}}
Users never see Special:FormStart and never choose page names.
5) BrowseItems page
This page shows all items in a gallery.
== Browse Items ==
{{#cargo_query:
tables=Items
|fields=Title,Image
|format=gallery
|image size=200
}}
Notes:
- tables=Items must be on its own line.
- All other parameters start with |.
- Produces a clickable gallery of all postcards.
6) Final User Workflow
Club members now follow a simple workflow:
- Go to Add a new item
- Click the button
- Fill in Title + upload an image
- Save
- The item appears automatically in Browse Items
No technical knowledge required.
7) System Status
The system now provides:
- A working Cargo table
- A working PageForms form
- Automatic page naming
- Working file uploads
- A clean Add Item button
- A gallery-style Browse page
- A stable foundation for future expansion