Jump to content

ICT:FinalConfig - PLACE

From Costa Sano MediaWiki
Revision as of 11:08, 17 February 2026 by Mngr (talk | contribs)

Final Configuration for the Place Entity

Document revision: 2026-02-17 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 implementation of one entity "Place".

This entity has a special feature: filling in the address will automatically fill in the coordinates and, in the dashboard, provide a link to OpenStreetMap. In order to realize this, JavaScript is used.

As the system uses de facto Dark mode, special care is taken to avoid default MediaWiki or Page Forms error messages that render as white boxes. Using the Vector-2022 skin, modifying Common.css proved unreliable; therefore, JavaScript-based solutions were preferred.

This configuration deliberately favors explicit behavior and robustness over visual polish or implicit framework behavior, in order to ensure long-term maintainability.

Cargo Table:

Template:Place

<noinclude>
Place data template
</noinclude>

{{#cargo_declare:
 |_table=Places
 |Code=Page
 |Parent=Page
 |Label=String
 |Type=String
 |Address=String
 |Latitude=Float
 |Longitude=Float
 |Notes=Text
}}

{{#cargo_store:
 |Code={{FULLPAGENAME}}
 |Parent={{{Parent|}}}
 |Label={{{Label|}}}
 |Type={{{Type|}}}
 |Address={{{Address|}}}
 |Latitude={{{Latitude|}}}
 |Longitude={{{Longitude|}}}
 |Notes={{{Notes|}}}
}}

== {{{Label|}}} ==
{{DISPLAYTITLE:{{{Label}}}}}

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

'''Notes:'''
{{{Notes|}}}

{{#if:{{{Latitude}}}{{{Longitude}}}| 
'''Map:'''  
[https://www.openstreetmap.org/?mlat={{{Latitude}}}&mlon={{{Longitude}}} View on OpenStreetMap]
}}

Once the template is created, the Cargo table must be created manually. If modifications are made to the table structure, the table must be recreated and the temporary table swapped via the Cargo administration interface.

The field Code stores the full page name (including namespace) to ensure unambiguous identification and safe use as a foreign key across entities.

Important conventions: - Field names start with a capital letter - Code is the page name and acts as the technical identifier - Label is the human-readable name and is mandatory for all entities - Dashboards generate and manage pages in a dedicated namespace (Place) - The field name Label must not be renamed, as it is relied upon by shared JavaScript validation logic

Special lines at the bottom of the template:

== {{{Label|}}} ==
{{DISPLAYTITLE:{{{Label}}}}}

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

'''Notes:'''
{{{Notes|}}}

{{#if:{{{Latitude}}}{{{Longitude}}}| 
'''Map:'''  
[https://www.openstreetmap.org/?mlat={{{Latitude}}}&mlon={{{Longitude}}} View on OpenStreetMap]
}}

These lines ensure that the human-readable name (Label) is consistently used as the visible page title, while the actual page name remains the stable technical identifier (Code).

This decoupling allows renaming the label without breaking Cargo relations, dashboards, or foreign keys.

The last block conditionally displays a link to OpenStreetMap only when valid geographic coordinates are present, avoiding broken or misleading links.

Coordinates are normally filled automatically via JavaScript based on the Address field.

Page Form:

Form:Place


Form for creating and editing Place pages.


no summary

Fields marked with (*) are required.

Place

Code FinalConfig - PLACE
Name (*) Label
Parent place Parent
Type Type
Address Address
Latitude Latitude
Longitude Longitude
Notes Notes|input type=tex