Jump to content

ICT:FinalConfig - PLACE: Difference between revisions

From Costa Sano MediaWiki
Created page with "= Final Configuration for the Place Entity = Document revision: {{#time:Y-m-d|{{REVISIONTIMESTAMP}}}} by {{REVISIONUSER}} The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page. The Cargo template follows what has been decided in the DBML. It is the second implementation of an entity in order to finetune a final dashboard layout. = Cargo Table: = Template:Place <pre> <noinclude> Pl..."
 
No edit summary
Line 5: Line 5:
The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page.  
The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page.  
The Cargo template follows what has been decided in the DBML. It is the second implementation of an entity in order to finetune a final dashboard layout.
The Cargo template follows what has been decided in the DBML. It is the second implementation of an entity in order to finetune a final dashboard layout.
This entity have a special feature: filling in the address will give the coordinnates and in dashboard you then have a link to openstreetmap. In order to realise this a javascript is an extra.


= Cargo Table: =
= Cargo Table: =
Template:Place
Template:Place
<pre>
<pre>
<noinclude>
<<noinclude>
Place data template
Place data template


Line 18: Line 19:
  |parent=Page
  |parent=Page
  |type=String
  |type=String
|address=String
  |latitude=Float
  |latitude=Float
  |longitude=Float
  |longitude=Float
Line 31: Line 33:
  |parent={{{parent|}}}
  |parent={{{parent|}}}
  |type={{{type|}}}
  |type={{{type|}}}
|address={{{address|}}}
  |latitude={{{latitude|}}}
  |latitude={{{latitude|}}}
  |longitude={{{longitude|}}}
  |longitude={{{longitude|}}}
Line 37: Line 40:


== {{{title|}}} ==
== {{{title|}}} ==
{{DISPLAYTITLE:{{{title}}}}}
{{#if:{{{parent|}}}|Parent place: [[{{{parent}}}]]}}


</pre>
</pre>
Line 65: Line 72:
{| class="formtable"
{| class="formtable"


| Parent Place
! Title
| {{{field|title|mandatory}}}
|-
 
! Code
| {{PAGENAME}}
|-
 
! Parent Place
| {{{field|parent
| {{{field|parent
   |label=Parent place
   |label=Parent place
Line 72: Line 87:
   |existing values only
   |existing values only
   |placeholder=Top level (no parent)
   |placeholder=Top level (no parent)
}}}
}}}
|-
|-


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


! Code
! Address
| {{PAGENAME}}
| {{{field|address|id=pf-address}}}
|-


! Type
| {{{field|type
  |input type=dropdown
  |values=city,site,region,building
}}}
|-
|-
! Latitude
| {{{field|latitude|id=pf-latitude}}}


! Latitude
| {{{field|latitude|input type=text|size=20}}}
|-
|-
! Longitude
| {{{field|longitude|id=pf-longitude}}}


! Longitude
| {{{field|longitude|input type=text|size=20}}}
|-
|-


Line 119: Line 128:
}}}
}}}
</pre>
</pre>
In the display of the Form;Place page one might see
<pre>
{{{end template}}}
</pre>
at the bottom. This is not a bug but a side effect too long to explain here.


= Dashboard page =
= Dashboard page =
Line 128: Line 142:


{| class="wikitable sortable"
{| class="wikitable sortable"
! Code !! Title !! Type !! Parent
! Code !! Title !! Type !! Parent !! Map
{{#cargo_query:
{{#cargo_query:
  tables=Places
  tables=Places
  |fields=_pageName,code,title,type,parent
  |fields=_pageName,code,title,type,parent,latitude,longitude
  |where=_pageNamespace=3006
  |where=_pageNamespace=3006
  |order by=code
  |order by=code
Line 142: Line 156:


Choose your place code corresponding to above table and respecting the naming conventions.
Choose your place code corresponding to above table and respecting the naming conventions.
Take maximum 4 capital letters for the code.


{{#forminput:
{{#forminput:
Line 149: Line 164:
  |returnto=Dashboard:Place
  |returnto=Dashboard:Place
}}
}}


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


Line 177: Line 195:
| {{#formlink:form=Place|target={{{_pageName}}}|link text={{{code}}}|returnto=Dashboard:Place}}
| {{#formlink:form=Place|target={{{_pageName}}}|link text={{{code}}}|returnto=Dashboard:Place}}
| {{{title}}}
| {{{title}}}
| {{{type}}}
| {{#switch:{{{type}}}
    |city=🏙️ City
    |region=🗺️ Region
    |building=🏛️ Building
    |site=📍 Site
    |#default=📌 {{{type}}}
  }}
| {{{parent}}}
| {{{parent}}}
| {{#if:{{{latitude}}}{{{longitude}}}|[https://www.openstreetmap.org/?mlat={{{latitude}}}&mlon={{{longitude}}} 🗺️]}}
</includeonly>
</includeonly>



Revision as of 16:05, 14 February 2026

Final Configuration for the Place Entity

Document revision: 2026-02-14 by Mngr

The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page. The Cargo template follows what has been decided in the DBML. It is the second implementation of an entity in order to finetune a final dashboard layout. This entity have a special feature: filling in the address will give the coordinnates and in dashboard you then have a link to openstreetmap. In order to realise this a javascript is an extra.

Cargo Table:

Template:Place

<<noinclude>
Place data template

{{#cargo_declare:
 _table=Places
 |title=String
 |code=String
 |parent=Page
 |type=String
 |address=String
 |latitude=Float
 |longitude=Float
 |notes=Text
}}

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

{{#cargo_store:
 title={{{title|}}}
 |code={{PAGENAME}}
 |parent={{{parent|}}}
 |type={{{type|}}}
 |address={{{address|}}}
 |latitude={{{latitude|}}}
 |longitude={{{longitude|}}}
 |notes={{{notes|}}}
}}

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

{{DISPLAYTITLE:{{{title}}}}}

{{#if:{{{parent|}}}|Parent place: [[{{{parent}}}]]}}

Once the template is created don't forget to manually force the creation of the Cargo table. If modifications are done to the table, one 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:Place

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

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

{{{for template|Place}}}

{| class="formtable"

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

! Code
| {{PAGENAME}}
|-

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

! Type
| {{{field|type}}}
|-

! Address
| {{{field|address|id=pf-address}}}

|-
! Latitude
| {{{field|latitude|id=pf-latitude}}}

|-
! Longitude
| {{{field|longitude|id=pf-longitude}}}

|-

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

In the display of the Form;Place page one might see

{{{end template}}}

at the bottom. This is not a bug but a side effect too long to explain here.

Dashboard page

Dashboard:Place

= 🗺️ Costa Sano Research PLACE Dashboard =

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

{| class="wikitable sortable"
! Code !! Title !! Type !! Parent !! Map
{{#cargo_query:
 tables=Places
 |fields=_pageName,code,title,type,parent,latitude,longitude
 |where=_pageNamespace=3006
 |order by=code
 |format=template
 |template=PlaceRow
 |named args=yes
 |cache=no
}}
|}

Choose your place code corresponding to above table and respecting the naming conventions.
Take maximum 4 capital letters for the code.

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





<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 is needed on the Cargo side to avoid caching and the following puts a new datetime on the page making it different from the previous 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:PlaceRow as described below. It makes the first column of the table clickable to go back to the Form and edit the record.

Row transclusion Template

Template:PlaceRow

<includeonly>
|-
| {{#formlink:form=Place|target={{{_pageName}}}|link text={{{code}}}|returnto=Dashboard:Place}}
| {{{title}}}
| {{#switch:{{{type}}}
     |city=🏙️ City
     |region=🗺️ Region
     |building=🏛️ Building
     |site=📍 Site
     |#default=📌 {{{type}}}
  }}
| {{{parent}}}
| {{#if:{{{latitude}}}{{{longitude}}}|[https://www.openstreetmap.org/?mlat={{{latitude}}}&mlon={{{longitude}}} 🗺️]}}
</includeonly>

All this creates pages in the namespace Place 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.

{{Place
|title=Berck-sur-Mer
|type=city
|latitude=50.406
|longitude=1.563
|notes=Important location for early Costa Sano history.
}}

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

References: