HOC SiteDokümantasyon

save_component

Create or update a reusable component. content may be a document object or a JSON string of that document. contentMode replace writes that document instead of the default sparse merge. contentByLocale writes several locales in one call (same rules as save_page; update only). A block saved without props.id receives one. Put named dataRequests, inputSchema, and editor variables on content.root.props (not top-level). Shape: dataRequests[{name,op:list|get|create|update|delete|updateMatching,objectTypeId,args?,select?,resultWrites?}]. Tokens {{var:id}} / {{bind:route.*}}. Prefer save_component_preset for list/detail/form starters. The response includes revisionId, versionId, and revisionNo. warnings=new (default) returns only new design warnings plus preExistingWarningCount. Docs: design/shared-concepts/data-requests.

save_component · Grup: design

Girdiler

websiteId

zorunlu

componentId

isteğe bağlı

label

isteğe bağlı

content

isteğe bağlı

contentMode

isteğe bağlı — merge (default) updates listed blocks by id and keeps the rest. replace writes this content as the whole document.

ops

isteğe bağlı

contentByLocale

isteğe bağlı

contentLocale

isteğe bağlı

response

isteğe bağlı

warnings

isteğe bağlı — new (default) | all | none

dryRun

isteğe bağlı

previewToken

isteğe bağlı — From a prior dryRun; pass on a follow-up write when re-auth is needed (do not scrape from previewUrl)

Şema

{
  "name": "save_component",
  "group": "design",
  "inputFields": [
    {
      "name": "websiteId",
      "required": true
    },
    {
      "name": "componentId",
      "required": false
    },
    {
      "name": "label",
      "required": false
    },
    {
      "name": "content",
      "required": false
    },
    {
      "name": "contentMode",
      "required": false,
      "description": "merge (default) updates listed blocks by id and keeps the rest. replace writes this content as the whole document."
    },
    {
      "name": "ops",
      "required": false
    },
    {
      "name": "contentByLocale",
      "required": false
    },
    {
      "name": "contentLocale",
      "required": false
    },
    {
      "name": "response",
      "required": false
    },
    {
      "name": "warnings",
      "required": false,
      "description": "new (default) | all | none"
    },
    {
      "name": "dryRun",
      "required": false
    },
    {
      "name": "previewToken",
      "required": false,
      "description": "From a prior dryRun; pass on a follow-up write when re-auth is needed (do not scrape from previewUrl)"
    }
  ]
}

Eşlendiği uçlar

  • POST /api/v1/{locale}/{websiteId}/components → API
  • PUT /api/v1/{locale}/{websiteId}/components/{id} → API

İlgili