Help topics

Create a model

A model is a kind of content, such as articles or products. Create one to get its own list, editor and API address.

Before you start

  • You need the Administrator role. Other users see the error Only administrators can change models.

Create the model

  1. Go to Models in the side list.
  2. Select the plus button (New model) next to Models. Morphic opens the New model page.
  3. In Name, enter a name in singular or plural form, for example Articles. Morphic fills in API name from it: article.
  4. In API name, check the value. Use lowercase letters, digits and underscores, and start with a letter. The help text ends with "Cannot change later."

Warning: Morphic refuses an API name that a model already uses. It shows "There is already a model called" followed by the name. Choose a new API name before you save.

  1. In Id prefix, enter three lowercase letters, for example art. Every entry id starts with this prefix. Each prefix can be used by one model only.
  2. Optional: In Description, enter what editors put in this model.
  3. Select Create model.

Result: Morphic shows the toast "Model created. Now add fields." and opens the model. Then add fields with Add and configure fields.

Name and address rules

  • API name uses lowercase letters, digits and underscores, starts with a letter, and has up to 64 characters. You cannot change it later.
  • Id prefix is exactly three lowercase letters. You cannot change it later.
  • The model's entries are served at /wp-json/morphic/v1/items/<API name>, for example /wp-json/morphic/v1/items/article. Access settings decide who can read them.
  • If the API name breaks the rule, for example 1Bad-Name, Morphic shows "Type names are lowercase snake, up to 64 characters".

Create a component

Components are field groups that you reuse inside models.

  1. Select New component on the Models page.
  2. In Name, enter a name for the component.
  3. Optional: In Description, enter what the component contains.
  4. Select Create component.

Result: Morphic shows the toast "Component created. Now add fields."

Key-value namespaces

Key-value namespaces are not available in Morphic free. The side list shows Available in Pro under Key-value.