Building a metaobject

You can create metaobjects from two locations in your Shopify admin:

  • FromContent>Metaobjects
  • FromSettings>Custom data

When you create a metaobject, you specify the following information:

  • the name, which is used to identify the metaobject in your Shopify admin
  • the type, which is automatically generated and editable, and is used to identify the metaobject in the APIs
  • the fields, which define the type of content you want to display in the metaobject
    • Each field has a name, description, type, and validation rules such as character limits, minimum and maximum values, or preset values.
    • For example, you might add a field for text, a field for an image, and a field for color.

Build a new metaobject

Steps:

  1. From your Shopify admin, go toContent>MetaobjectsorSettings>Custom data.
  2. Click添加definition.
  3. In theNamefield, enter a name for your defintion. A type for your metaobject is automatically generated, and can be edited prior to saving the metaobject.
  4. Click添加fieldand select the content type you want to contain in this metaobject. For example, single line text. Each field has its own set of options and validation rules.
  5. Configure the field and its validation information:
    1. Optional: In theDescriptionfield, enter a description for your metaobject.
    2. Choose whether the field will be the entry’s display name by selectingUse this field as display name. The display name is the field that’s used to generate a searchable name in the index view. The display name is automatically set to the first text-based field in your metaobject definition or generated automatically if there is no text field.
    3. Configure the validation rules for the field, and then click添加.
  6. Optional: To turn off storefront access, deselectStorefrontsfrom theAccesssection.
  7. Optional: To allow entries from this metaobject to be published as stand-alone pages, selectWeb pagesunderFeatures.
  8. 添加additional fields to your metaobject as needed.
  9. ClickSave.

After your metaobject has been saved, you can startcreating entries.

Deleting a metaobject

Deleting a metaobject can't be undone. If you delete a metaobject, then all the entries for that metaobject will also be deleted.

Steps:

  1. From your Shopify admin, go toSettings>Custom data.
  2. In theMetaobjects部分,点击你的元对象want to delete.
  3. Click删除. A confirmation dialog displays to confirm that you want delete the definition.
  4. Click删除to remove the definition.
Ready to start selling with Shopify?Try it free