Cargo-based Template-Form-Table Architecture

From Salish Sea Wiki

This platform uses off-the-shelf integration of Cargo and Page Forms to create Templates that control Page Type editing and structured data.

Forms

A form is used to control page editing, so that good quality structured data are created for each page.

Each form as the following critical elements:

  • {{{info|}} is used to create a working page title for the form, including constructing a page name from a set of structured data.
  • {{{for template|}}} indicates that template that is being used, and that all the field names used thereafter are based on that template.
  • Then there are a series of form elements that are used to collect data using the {{{field|}}} tag.
  • An {{{end template}}} parser function indicates the end of the form.

When the form is submitted, the form content is written to a cargo record, based no the instructions in the template.

Templates

We have 5 special page type templates. These templates use the Cargo Extension to allow the following functions:

  • The use a {{#cargo_declare}} parser function to create a cargo table for each template
  • They use a {{#cargo_store}} parser function to construct the value in fields that are NOT controlled directly by the form. For example you can use this to add the contents of several field to construct a single field that is easier to query. This is how the Product Name and Categories fields are constructed using the complex Form:Product
  • The template controls formatting and the construction of an info box or other features.
  • The {{#arraymap:}} parser function is used to render categories for a page that are based on the structured data in a cargo table.

Tables

The template combined with the form establishes and writes information into a table.

Questions

  1. Is there any risk to changing a template before you have a final data structure?
  2. What happens if you change the #cargo_declare after the template data has been created among a number of pages?
    • Do how do you repopulate the cargo table?
  3. Where do you change the
  4. Suggestions for using ReplaceText to change value across cargo data.. (change ";Agriculture" only when it follows "|AnthroTopic=" ??)
  5. How do I test Templates and Forms before passing package for migration
  6. What is the section?