Jump to content

ICT:Cargo-Workflow: Difference between revisions

From Costa Sano MediaWiki
Cargo - first workflow steps
 
mNo edit summary
Line 6: Line 6:
== 1) LocalSettings.php configuration ==
== 1) LocalSettings.php configuration ==


<syntaxhighlight lang="php">
#----------------------------------
# Cargo extension
# Cargo extension
#----------------------------------
$wgCargoDBtype = "mysql";
$wgCargoDBtype = "mysql";
$wgCargoDBserver = "10.10.10.2";
$wgCargoDBserver = "10.10.10.2";
Line 20: Line 17:
wfLoadExtension( 'Cargo' );
wfLoadExtension( 'Cargo' );


#----------------------------------
# PageForms extension
# PageForms extension
#----------------------------------
wfLoadExtension( 'PageForms' );
wfLoadExtension( 'PageForms' );
$wgPageFormsUploadableFiles = true;
$wgPageFormsUploadableFiles = true;
</syntaxhighlight>


'''Important:'''   
'''Important:'''   
`$wgPageFormsUploadableFiles = true;` must appear ''after'' `wfLoadExtension( 'PageForms' );`.
$wgPageFormsUploadableFiles = true; must appear ''after'' wfLoadExtension( 'PageForms' ).


----
----
Line 36: Line 30:
This template defines the Cargo table and how each item page displays.
This template defines the Cargo table and how each item page displays.


<syntaxhighlight lang="text">
<includeonly>
<includeonly>
{{#cargo_declare:
{{#cargo_declare:
Line 48: Line 41:
'''Image:''' [[File:{{{Image}}}|400px]]
'''Image:''' [[File:{{{Image}}}|400px]]
</includeonly>
</includeonly>
</syntaxhighlight>


Notes:
Notes:
* Only the `<includeonly>` section is used by Cargo and PageForms.   
* 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 60: Line 52:
This is the form used to create new items.
This is the form used to create new items.


<syntaxhighlight lang="text">
{{{info|page name=Item_<unique number>}}}
{{{info|page name=Item_<unique number>}}}
{{{for template|Item}}}
{{{for template|Item}}}
Line 74: Line 65:
{{{standard input|save}}}
{{{standard input|save}}}
{{{standard input|cancel}}}
{{{standard input|cancel}}}
</syntaxhighlight>


Key points:
Key points:
* The `info` directive '''must be the first line''' (no blank lines above it).   
* The info directive '''must be the first line''' (no blank lines above it).   
* `input type=upload|uploadable` enables the upload widget.   
* input type=upload|uploadable enables the upload widget.   
* Page names are automatically generated: `Item_0001`, `Item_0002`, …
* Page names are automatically generated: Item_0001, Item_0002, …


----
----
Line 87: Line 77:
This page provides a simple button for club members to add new items.
This page provides a simple button for club members to add new items.


<syntaxhighlight lang="text">
== Add a new item ==
== Add a new item ==


Line 93: Line 82:


{{#formlink:form=Item|link text=➕ Add a new item|link type=button}}
{{#formlink:form=Item|link text=➕ Add a new item|link type=button}}
</syntaxhighlight>


Users never see `Special:FormStart` and never choose page names.
Users never see Special:FormStart and never choose page names.


----
----
Line 103: Line 91:
This page shows all items in a gallery.
This page shows all items in a gallery.


<syntaxhighlight lang="text">
== Browse Items ==
== Browse Items ==


Line 112: Line 99:
   |image size=200
   |image size=200
}}
}}
</syntaxhighlight>


Notes:
Notes:
* `tables=Items` must be on its own line.   
* tables=Items must be on its own line.   
* All other parameters start with `|`.   
* All other parameters start with |.   
* Produces a clickable gallery of all postcards.
* Produces a clickable gallery of all postcards.


Line 144: Line 130:
* Working file uploads   
* Working file uploads   
* A clean Add Item button   
* A clean Add Item button   
* A gallery‑style Browse page   
* A gallery-style Browse page   
* A stable foundation for future expansion (metadata, item types, etc.)
* A stable foundation for future expansion (metadata, item types, etc.)


----
----

Revision as of 11:23, 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

  1. Cargo extension

$wgCargoDBtype = "mysql"; $wgCargoDBserver = "10.10.10.2"; $wgCargoDBname = "cargodb"; $wgCargoDBuser = "cargouser"; $wgCargoDBpassword = "Mhv+mak!90"; $wgCargoDBprefix = ""; $wgCargo24HourTime = true;

wfLoadExtension( 'Cargo' );

  1. 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.


Notes:

  • Only the