Skip to content
  1. Extras
  2. MiniShop3
  3. Manager interface
  4. Utilities
  5. Model fields

Utilities: Model fields

Managing existing model fields from the database.

Purpose

The tool manages fields registered in the ms3_product_fields table:

  • View all model fields
  • Edit display settings
  • Bind fields to sections
  • Configure widgets (xtype)
  • Manage field sections

Difference from "Extra fields"

AspectModel fieldsExtra fields
SourceExisting DB fieldsNew fields
Creating columnsNoYes (ALTER TABLE)
DeleteConfig onlyFull removal
UseDisplay configSchema extension

Interface

Model selection

Model filter at the top:

  • msProductData — product data
  • msVendor — vendors
  • msOrder — orders
  • msOrderAddress — addresses

Sections panel

Left panel lists sections for the selected model.

Section actions:

  • Add section
  • Edit section
  • Delete section
  • Reorder (drag-and-drop)

Fields table

Right side shows fields and settings:

ColumnDescription
NameSystem field name
LabelDisplay name
Type (xtype)Widget type
SectionSection
VisibleShow field
WidthGrid width (3-12)

Editing a field

Click a row to open the edit dialog.

Basic parameters

ParameterDescription
LabelDisplay name
DescriptionHint under input
SectionGroup for the field
VisibleShow in form

Widget type (xtype)

TypeDescription
textfieldText field
numberfieldNumber field
textareaMulti-line field
comboDropdown
datefieldDate picker
checkboxCheckbox

Grid width

12-column grid:

ValueWidthDescription
325%Quarter
433%Third
650%Half
867%Two thirds
12100%Full row

Combo data source

For combo type use JSON config:

json
{
  "store": [
    ["value1", "Option 1"],
    ["value2", "Option 2"],
    ["value3", "Option 3"]
  ]
}

Or load from API:

json
{
  "url": "/api/mgr/options/list",
  "valueField": "id",
  "displayField": "name"
}

Section management

Creating a section

  1. Click "+" in the sections panel
  2. Fill the form:
FieldDescription
KeyUnique identifier
LabelDisplay name
OrderPosition in list

Editing a section

Click the edit icon next to the section name.

Deleting a section

Note

When a section is deleted, its fields move to "No section". Fields are not deleted.

Section order

Drag sections to reorder.

Examples

Grouping price fields

  1. Create section "Prices":

    • Key: prices
    • Label: Prices
  2. Move fields into it:

    • price → Prices
    • old_price → Prices
    • wholesale_price → Prices (if added)

Field width

For compact layout:

FieldWidth
article6 (50%)
price3 (25%)
old_price3 (25%)
weight4 (33%)
remains4 (33%)

Hiding technical fields

Commonly hidden:

  • id — auto-generated
  • createdon — technical dates
  • source — if using a single source

API Endpoints

List models

GET /api/mgr/model-fields/models

Response:

json
{
  "success": true,
  "object": {
    "models": [
      { "value": "msProductData", "label": "Product data" },
      { "value": "msVendor", "label": "Vendor" }
    ]
  }
}

List model fields

GET /api/mgr/model-fields?model=msProductData

Update field

PUT /api/mgr/model-fields/{id}

Request body:

json
{
  "label": "Product SKU",
  "xtype": "textfield",
  "section_id": 1,
  "visible": true,
  "width": 6,
  "description": "Unique product code"
}

Model sections

GET /api/mgr/model-fields/sections?model=msProductData

Create section

POST /api/mgr/model-fields/sections

Request body:

json
{
  "model": "msProductData",
  "key": "prices",
  "label": "Prices",
  "sort_order": 10
}

Delete section

DELETE /api/mgr/model-fields/sections/{id}

Relation to config

Changes here affect:

  1. Product card — field display on the "Data" tab
  2. Grids — available columns
  3. Import — fields available for mapping
  4. API — object serialization

To see changes you may need to:

  • Reload the page
  • Clear browser cache
  • Clear MODX cache