Jump to content

ICT:THE pattern starter kti

From Costa Sano MediaWiki
Revision as of 17:10, 8 February 2026 by Mngr (talk | contribs) (Created page with "= ICT Starter Kit — Entity Module = This kit provides the four files required to create a new structured data module: * Template:EntityName * Form:EntityName * Dashboard:EntityName * Template:EntityRow Replace: * EntityName → the namespace and form/template name * TableName → the Cargo table name * field1, field2… → your actual fields ---- == 1. Template:EntityName == <pre> <noinclude> Documentation for EntityName template. {{#cargo_declare: _table=Table...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ICT Starter Kit — Entity Module

This kit provides the four files required to create a new structured data module:

  • Template:EntityName
  • Form:EntityName
  • Dashboard:EntityName
  • Template:EntityRow

Replace:

  • EntityName → the namespace and form/template name
  • TableName → the Cargo table name
  • field1, field2… → your actual fields

1. Template:EntityName

<noinclude>
Documentation for EntityName template.

{{#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|}}} ==

2. Form:EntityName

<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}}}

3. Template:EntityRow

<includeonly>
|-
| {{#formlink:form=EntityName
    |target={{{_pageName}}}
    |link text={{{field1}}}
    |returnto=Dashboard:EntityName
  }}
| {{{field2}}}
| {{{field3}}}
</includeonly>

4. Dashboard:EntityName

= EntityName Dashboard =

{| class="wikitable sortable"
! Field1 !! Field2 !! Field3
{{#cargo_query:
 tables=TableName
 |fields=_pageName,field1,field2,field3
 |where=_pageNamespace=EntityName
 |order by=field1
 |format=template
 |template=EntityRow
 |named args=yes
 |cache=no
}}
|}

{{#forminput:
 form=EntityName
 |namespace=EntityName
 |button text=➕ New EntityName
 |returnto=Dashboard:EntityName
}}

5. Quick Setup Checklist

  1. Create Template:EntityName
  2. Create Form:EntityName
  3. Create Template:EntityRow
  4. Create Dashboard:EntityName
  5. Replace EntityName, TableName, and fields
  6. Verify:
    1. Form name = Template name = Namespace
    2. standard input|save present
    3. #forminput:form=EntityName in template
    4. Dashboard uses correct namespace
    5. Row template uses #formlink

This kit can be reused for any new module (Persons, Locations, Events, Assets…).