Jump to content

ICT:FinalConfig-Chapter

From Costa Sano MediaWiki
Revision as of 14:35, 13 February 2026 by Mngr (talk | contribs)

Final Configuration for the Chapter Entity

Document revison: 2026-02-13


The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnessessary elements on the page. The Cargo template follows what has been decided in the DBML. It is the first implementation of an entity in order to finetune a final dashboard layout.

Cargo Table:

Template:Chapter

<noinclude>
Chapter data template

{{#cargo_declare:
 _table=Chapters
 |title=String
 |code=String
 |parent=Page
 |sequence_number=Integer
 |description=Text
 |start_date=Date
 |end_date=Date
 |notes=Text
}}

{{#forminput:form=Chapter}}
</noinclude>

{{#cargo_store:
 title={{{title|}}}
 |code={{PAGENAME}}
 |sequence_number={{{sequence_number|}}}
 |description={{{description|}}}
 |start_date={{{start_date|}}}
 |end_date={{{end_date|}}}
 |notes={{{notes|}}}
 |parent={{{parent|}}}

}}

== {{{title|}}} ==

Once the template is created don't forget to manually force the creation of the Cargo table. If modifications are done to the table. On needs to manually update the table and then go to the Cargo interface to swap the temporary table to become the official one. Take care what is inside and outside

<noinclude>

Page Form:

Form:Chapter

<noinclude>
Form for creating and editing Chapter pages.
</noinclude>

{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}

{{{for template|Chapter}}}

{| class="formtable"

| Parent Chapter
| {{{field|parent
  |label=Parent chapter
  |input type=combobox
  |values from namespace=Chapter
  |existing values only
  |placeholder=Top level (no parent)
 }}}
|-

! Title
| {{{field|title|mandatory}}}
|-

! Code
| {{PAGENAME}}
|-

! Description
| {{{field|description|input type=textarea}}}
|-

! Start date
| {{{field|start_date|input type=datepicker|year range=1800:2100|show year dropdown|show month dropdown}}}
|-

! End date
| {{{field|end_date|input type=datepicker|year range=1800:2100|show year dropdown|show month dropdown}}}
|-

! Notes
| {{{field|notes|input type=textarea}}}

|}

{{{standard input|save}}}


{{{end template}}}

The first section is important to avoid clutter.

{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}

Dashboard page

Dashboard:Chapter

= 📘 Costa Sano Research CHAPTER Dashboard =


📖 [[Dashboard:Chapter/Help|Need Help?]]

{| class="wikitable sortable"
! Code !! Title !! Parent
{{#cargo_query:
 tables=Chapters
 |fields=_pageName,code,title,parent
 |where=_pageNamespace=3004
 |order by=code
 |format=template
 |template=ChapterRow
 |named args=yes
 |cache=no
}}
|}

Choose your chapter code corresponding to above table and respectiong the convention CHxx.y.z

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

<div style="text-align:right; font-size:90%;">
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>

Different measures are taken to deal with caching data in MediaWiki, Cargo and what happens in a browser.

 |cache=no

this needed on the Cargo side to avoid caching and the following puts a new datetime on the page making it different from the precious version with the result that the page is renewed and the cached version is dropped.

<div style="text-align:right; font-size:90%;">
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>

The layout of the dashboard makes use of a Template;ChapterRow as descirbed below. It makes the first colomn of the table clickeble to go back to the Form and edit the record.

Row transclusion Template

Template:ChapterRow

<includeonly>
|-
| {{#formlink:form=Chapter|target={{{_pageName}}}|link text={{{code}}}|returnto=Dashboard:Chapter}}
| {{{title}}}
| {{{parent}}}
</includeonly>

All this creates pages in the namespace Chapter with the name being the code. The page is a configuration to serve in Page Forms extension. Below is an example of such a page.

{{Chapter
|title=In the beginning
|description=Chapter describing what happened before Berck-sur-Mer...
|start_date=1800-01
|end_date=1849-12
|notes=NIHIL
}}

As you can see the page as is cannot be used as such and should be read via the dashboard page.

References: