mirror of https://github.com/onweru/compose.git

weru
02.29.2025 435f1a7a2f2c3ec6924e3ec2c726c23d5453cc25
exampleSite/tina/collections/menu.ts
@@ -0,0 +1,50 @@
import { Collection } from "tinacms";
const Menu: Collection = {
  name: "menu",
  label: "Menus",
  path: "config/_default/menus/",
  format: "toml",
  ui: {
    allowedActions: {
      create: false,
      delete: false,
    }
  },
  match: {
    include: "*menu*",
  },
  fields: [
    {
      type: "object",
      name: "main",
      label: "Main Menu",
      list: true,
      ui: {
        itemProps: (item) => {
          return { label: item?.name };
        }
      },
      fields: [
        {
          type: "string",
          name: "name",
          label: "Name"
        },
        {
          type: "string",
          name: "url",
          label: "URL"
        },
        {
          type: "string",
          name: "weight",
          label: "Weight",
          description: "Controls ordering"
        },
      ]
    }
  ]
};
export default Menu;