Jump to content

ICT:Cargo-Workflow: Difference between revisions

From Costa Sano MediaWiki
No edit summary
m Replaced content with "<includeonly> {{#cargo_declare: _table=Items, Title=String, Image=File }} '''Title:''' {{{Title}}} '''Image:''' [[File:{{{Image}}}|400px]] </includeonly>"
Tag: Replaced
Line 1: Line 1:
= ICT:Cargo-Workflow – Final Working Configuration (Cargo + PageForms) =
&lt;includeonly&gt;
 
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 ==
 
<nowiki><pre>
# 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;
</pre></nowiki>
 
'''Important:''' 
$wgPageFormsUploadableFiles = true; must appear ''after'' wfLoadExtension( 'PageForms' ).
 
----
 
== 2) Template:Item ==
 
<nowiki><pre>
<includeonly>
{{#cargo_declare:
{{#cargo_declare:
   _table=Items,
   _table=Items,
Line 41: Line 9:


'''Image:''' [[File:{{{Image}}}|400px]]
'''Image:''' [[File:{{{Image}}}|400px]]
</includeonly>
&lt;/includeonly&gt;
</pre></nowiki>
 
Notes:
* Only the <includeonly> section is used by Cargo and PageForms. 
* The Image field must be declared as File.
 
----
 
== 3) Form:Item ==
 
<nowiki><pre>
{{{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}}}
</pre></nowiki>
 
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 ==
 
<nowiki><pre>
== 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}}
</pre></nowiki>
 
----
 
== 5) BrowseItems page ==
 
<nowiki><pre>
== Browse Items ==
 
{{#cargo_query:
  tables=Items
  |fields=Title,Image
  |format=gallery
  |image size=200
}}
</pre></nowiki>
 
----
 
== 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'''
 
----
 
== 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 
 
----

Revision as of 11:33, 5 January 2026

<includeonly>

Error: #cargo_declare must be called from a template page.

Title: {{{Title}}}

Image: [[File:{{{Image}}}|400px]] </includeonly>