Create Tables - lokothodida/DM_Matrix GitHub Wiki

Create a new table

Select The Matrix Tab in the admin panel. You will see a list of all your current tables, a system table '_routes' is created on the first run of the plugin.

manage-tables

To create a new table, click 'Add Table' and a new panel will be made visible. It will ask you to fill in the table name and maximum number of records that the table will hold.

add-table

Click on 'Fields: +' to add (more) fields to your table. You can add/edit/reorder fields after the table has been created.

add-field

Once you are finished, click the 'Add Table' button below and your table will be created.

Adding & Editing Fields

To add/modify/reorder the fields of an existing table, click on the table from the main tab and click 'Fields'.

foo-fields

Clicking the + will add new fields; clicking 'x' will delete them. Drag the fields to order them as desired. Hit 'Edit Fields' at the bottom of the page to save the changes.

Field Properties

Depending on how you want a particular field to be used, you'll want to configure its properties accordingly. The properties help to give specific functionality to the fields from within The Matrix's management panels.

  • Name - the name of the field, this should be just alphanumeric and dashes only. You can rename the field from this panel as well - renaming will fix the field name on all of your records.
  • Type - The type of field, see below for field types.
  • Label - Label to be displayed on the input form.
  • Description - A short description for your users to explain the field (turns up as a placeholder for the field).
  • Default - default value for the field to take in the form (and given to the 'create record' function if the field is left empty).
  • Field Size - width of the field column in the Matrix table view.
  • Cache - whether or not the field values will be cached when queries are performed.
  • Visibility - determines whether or not the field is visible in the form.
  • Table View - determines whether or not the field is visible in the table view.
  • Class - class given to the field for the form view (useful for structuring the form in the admin panel. Can take the values 'Normal', 'Metadata Window (Left)', 'Metadata Window (Right)', 'Left' or 'Right'.
  • Read Only - determines whether or not the field value can be changed from the form.

Field types are explored in Field Types.