Operazioni sulla navigazione

5 operazioni di nome navigation.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.

Aggiornato il
OperationWhat it doesPermissionConfirmation
navigation.readRead the draft menus of the site and their revision: each menu with its key (what the menu prop of a nav list, a menu dialog's list or the footer names), its label and its items.site.readnone
navigation.anchorsList what an anchor target may point at: each page with the anchors of its own tree, then the header and footer anchors every page shows, marked with their region.site.readnone
navigation.upsertWrite a whole menu, replacing the menu with its key or adding it after the others.site.editnone
navigation.deleteDelete a menu; a menu prop that names it then draws nothing.site.editdestructive
navigation.reorderReorder the items of a menu: itemIds names each item once, in the new order.site.editnone

Read the draft menus of the site and their revision: each menu with its key (what the menu prop of a nav list, a menu dialog's list or the footer names), its label and its items. An item has an id, a translatable label and a target of kind page { pageId }, anchor { pageId, anchor }, external { href } (an absolute, mail or phone link) or languages (one link per site locale); a top-level item may hold one level of children, and a child's group titles its column. A page or anchor target names its page by id. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.readreads onlyclass: read

Esempio di input

{}

Input

L’input è un record: vedi lo schema qui sotto.

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash navigation.read '{}' --dry-run

List what an anchor target may point at: each page with the anchors of its own tree, then the header and footer anchors every page shows, marked with their region. Each anchor is labelled with its first heading. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.readreads onlyclass: read

Esempio di input

{}

Input

L’input è un record: vedi lo schema qui sotto.

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Output

FieldTypeRequiredNotes

Provala

yarn splash navigation.anchors '{}' --dry-run

Write a whole menu, replacing the menu with its key or adding it after the others. A page or anchor target must name a page of the site; an anchor no section carries yet is a finding, not a refusal. An anchor of the header or footer (navigation.anchors marks it with its region) is shown by every page: target it as { kind: "anchor", pageId: <the home page id>, anchor: <the region anchor> }, never with the region's own page id, which is not a page of the site. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.editwrites: navigationclass: transactionundo: yes

Esempio di input

{
  "menu": {
    "key": "main",
    "label": "Main menu",
    "items": [
      {
        "id": "item0001",
        "label": {
          "it": "Il progetto",
          "en": "The project"
        },
        "target": {
          "kind": "anchor",
          "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
          "anchor": "progetto"
        }
      },
      {
        "id": "item0002",
        "label": "Studio",
        "target": {
          "kind": "page",
          "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f"
        }
      },
      {
        "id": "item0003",
        "label": "Instagram",
        "target": {
          "kind": "external",
          "href": "https://www.instagram.com/studio"
        }
      },
      {
        "id": "item0004",
        "label": "Languages",
        "target": {
          "kind": "languages"
        }
      },
      {
        "id": "item0005",
        "label": {
          "it": "Contatti",
          "en": "Contact"
        },
        "target": {
          "kind": "anchor",
          "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
          "anchor": "contatti"
        }
      }
    ]
  }
}

Input

FieldTypeRequiredNotes
menuobjectyes
menu.keystringyesAt most 40 characters.
menu.labelstringyesAt least 1 character. At most 80 characters.
menu.itemsarray of objectyesAt most 24 items.
{
  "type": "object",
  "properties": {
    "menu": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "maxLength": 40,
          "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "items": {
          "maxItems": 24,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        }
      },
      "required": [
        "key",
        "label",
        "items"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "menu"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema1"
        },
        "label": {
          "$ref": "#/$defs/__schema2"
        },
        "target": {
          "$ref": "#/$defs/__schema5"
        },
        "children": {
          "maxItems": 40,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema8"
          }
        }
      },
      "required": [
        "id",
        "label",
        "target"
      ],
      "additionalProperties": false
    },
    "__schema1": {
      "type": "string",
      "pattern": "^[0-9a-z]{8}$"
    },
    "__schema2": {
      "anyOf": [
        {
          "$ref": "#/$defs/__schema3"
        },
        {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/__schema4"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema3"
          }
        }
      ]
    },
    "__schema3": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "__schema4": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|\\d{3}))?$"
    },
    "__schema5": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "page"
            },
            "pageId": {
              "$ref": "#/$defs/__schema6"
            }
          },
          "required": [
            "kind",
            "pageId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "anchor"
            },
            "pageId": {
              "$ref": "#/$defs/__schema6"
            },
            "anchor": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,63}$"
            }
          },
          "required": [
            "kind",
            "pageId",
            "anchor"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "external"
            },
            "href": {
              "anyOf": [
                {
                  "$ref": "#/$defs/__schema7"
                },
                {
                  "type": "object",
                  "propertyNames": {
                    "$ref": "#/$defs/__schema4"
                  },
                  "additionalProperties": {
                    "$ref": "#/$defs/__schema7"
                  }
                }
              ]
            }
          },
          "required": [
            "kind",
            "href"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "languages"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema6": {
      "type": "string",
      "minLength": 1,
      "maxLength": 36
    },
    "__schema7": {
      "type": "string",
      "maxLength": 2048,
      "pattern": "^(?:https?:\\/\\/|mailto:|tel:|\\/(?!\\/))"
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema1"
        },
        "label": {
          "$ref": "#/$defs/__schema2"
        },
        "target": {
          "$ref": "#/$defs/__schema5"
        },
        "group": {
          "anyOf": [
            {
              "$ref": "#/$defs/__schema9"
            },
            {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema4"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema9"
              }
            }
          ]
        }
      },
      "required": [
        "id",
        "label",
        "target"
      ],
      "additionalProperties": false
    },
    "__schema9": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    }
  }
}

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash navigation.upsert '{"menu":{"key":"main","label":"Main menu","items":[{"id":"item0001","label":{"it":"Il progetto","en":"The project"},"target":{"kind":"anchor","pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","anchor":"progetto"}},{"id":"item0002","label":"Studio","target":{"kind":"page","pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f"}},{"id":"item0003","label":"Instagram","target":{"kind":"external","href":"https://www.instagram.com/studio"}},{"id":"item0004","label":"Languages","target":{"kind":"languages"}},{"id":"item0005","label":{"it":"Contatti","en":"Contact"},"target":{"kind":"anchor","pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","anchor":"contatti"}}]}}' --dry-run

Delete a menu; a menu prop that names it then draws nothing. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.editwrites: navigationclass: transactionconfirm: destructiveundo: yes

Esempio di input

{
  "key": "footer-legal"
}

Input

FieldTypeRequiredNotes
keystringyesAt most 40 characters.

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Vuole confirmed: ["destructive"] sul batch, che la forma della CLI per una sola operazione non imposta: mettila in un file di batch ed esegui yarn splash apply <file> --dry-run.

Reorder the items of a menu: itemIds names each item once, in the new order. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.editwrites: navigationclass: transactionundo: yes

Esempio di input

{
  "key": "main",
  "itemIds": [
    "item0002",
    "item0001",
    "item0003",
    "item0004",
    "item0005"
  ]
}

Input

FieldTypeRequiredNotes
keystringyesAt most 40 characters.
itemIdsarray of stringyesAt least 1 item.

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash navigation.reorder '{"key":"main","itemIds":["item0002","item0001","item0003","item0004","item0005"]}' --dry-run

Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 32867aaa66841a68).

Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.

Guida di Libretto

Colophon. Questa guida è un sito Libretto: 70 pagine in due lingue, 21 pagine della guida importate da Markdown e 42 pagine di riferimento generate dal registro delle operazioni. Composta in Softcore, il codice in IBM Plex Mono. La sua struttura:

/it/ Guida di Libretto /it/start Per iniziare /it/start/request-access Richiedere l'accesso /it/start/workspace Il tuo spazio di lavoro /it/start/first-site Il tuo primo sito /it/start/invite-a-client Invitare un cliente /it/start/connect-claude Connettere Claude a Libretto /it/build Costruire /it/build/first-page Costruire una pagina /it/build/layers-and-canvas Livelli e canvas /it/build/site-components Componenti del sito /it/design-system Design system /it/design-system/tokens Colori, spazi e temi /it/design-system/components Componenti e varianti /it/design-system/fonts Tipografia e font /it/motion Movimento /it/motion/scenes Scene e ricette /it/motion/image-sequences Sequenze di immagini /it/motion/reduced-motion Movimento ridotto /it/publish Pubblicazione /it/publish/languages Le lingue del sito /it/publish/versions Pubblicazione e versioni /it/publish/members-and-forms Iscritti e moduli /it/publish/domains Domini /it/publish/redirects Reindirizzamenti /it/handover Consegnare un sito al cliente /it/glossary Glossario /it/agents Agenti e API /it/agents/mcp Server MCP /it/agents/cli CLI /it/agents/batches Batch /it/agents/errors Errori e segnalazioni /it/agents/operations Operazioni /it/search Cerca