> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Content Overview

> Create and manage content items that follow ContentType definitions

A Content item is a concrete instance of a ContentType that follows the structure defined by its associated layout component. Content items maintain status-based versioning (draft/published) and reference specific package versions for stability.

## Key Concepts

<CardGroup cols={2}>
  <Card title="ContentType Binding" icon="link">
    References a specific ContentType version that determines the layout, allowed components, and package version.
  </Card>

  <Card title="Self-Contained" icon="box">
    Stores type version reference and maintains derived package and layout references for rendering stability.
  </Card>

  <Card title="Template Support" icon="copy">
    Content can serve as templates that inherit type structure and can be used as starting points for new content.
  </Card>

  <Card title="Compiled Output" icon="code">
    System automatically generates BindJS code from JSON content structure for native rendering.
  </Card>
</CardGroup>

## The Content Object

<ResponseField name="id" type="string">
  Unique identifier (UUID)
</ResponseField>

<ResponseField name="typeId" type="string">
  Reference to the ContentType
</ResponseField>

<ResponseField name="typeVersion" type="number">
  Version of the ContentType used
</ResponseField>

<ResponseField name="version" type="number">
  Content version number (increments on publish)
</ResponseField>

<ResponseField name="lastPublishedVersion" type="number">
  Last published version number (null if never published)
</ResponseField>

<ResponseField name="packageVersion" type="string">
  Package version being used (derived from typeVersion, immutable)
</ResponseField>

<ResponseField name="name" type="string">
  Display name
</ResponseField>

<ResponseField name="description" type="string">
  Structured markdown description for semantic search
</ResponseField>

<ResponseField name="status" type="string">
  Current status: `draft`, `modified`, `published`, `unpublished`, or `deleted`
</ResponseField>

<ResponseField name="isTemplate" type="boolean">
  Indicates if this is a template content
</ResponseField>

<ResponseField name="content" type="object">
  JSON structure where layout properties and component arrays are direct properties
</ResponseField>

<ResponseField name="compiled" type="string">
  Auto-generated BindJS code for rendering (system-managed)
</ResponseField>

<ResponseField name="tags" type="string[]">
  Categories/attributes for filtering
</ResponseField>

<ResponseField name="metadata" type="object">
  Additional content metadata

  <Expandable title="properties">
    <ResponseField name="author" type="string">Creator of the content</ResponseField>
    <ResponseField name="publishedAt" type="string">Publication timestamp</ResponseField>
    <ResponseField name="publishedBy" type="string">Publisher of the content</ResponseField>
    <ResponseField name="locale" type="string">Content locale</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="createdAt" type="string">
  Creation timestamp (ISO format)
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Last update timestamp (ISO format)
</ResponseField>

### Example Content

```json theme={null}
{
  "id": "cont124",
  "typeId": "ct123",
  "typeVersion": 2,
  "version": 1,
  "lastPublishedVersion": 1,
  "packageVersion": "1.0.0",
  "name": "Getting Started Guide",
  "description": "Getting Started with Metabind. A comprehensive guide...",
  "status": "published",
  "isTemplate": false,
  "content": {
    "title": "Getting Started with Metabind",
    "subtitle": "Your complete guide",
    "heroImage": "asset124",
    "author": "Jane Doe",
    "components": [
      {
        "type": "ArticleParagraph",
        "text": "Welcome to Metabind..."
      },
      {
        "type": "ArticleHeading",
        "text": "Key Features",
        "level": 2
      }
    ]
  },
  "compiled": "const body = () => { ... }",
  "tags": ["Technology", "Tutorial"],
  "metadata": {
    "author": "jane.doe@metabind.ai",
    "publishedAt": "2024-03-21T14:30:00Z",
    "locale": "en-US"
  },
  "createdAt": "2024-03-21T10:00:00Z",
  "updatedAt": "2024-03-21T14:30:00Z"
}
```

## Content Structure

Content is stored as JSON where layout properties and component arrays are direct properties:

### Single Section Example (Article)

```json theme={null}
{
  "title": "Getting Started with Metabind",
  "author": "Jane Doe",
  "publishDate": "2024-03-21",
  "heroImage": "asset456",
  "components": [
    {
      "type": "ArticleParagraph",
      "text": "Welcome to Metabind..."
    },
    {
      "type": "ArticleHeading",
      "text": "Key Features",
      "level": 2
    }
  ]
}
```

### Multi-Section Example (Quiz)

```json theme={null}
{
  "layout": "split",
  "shortTitle": "Math Quiz 1",
  "questions": [
    {
      "type": "Paragraph",
      "text": "What is the value of pi to 2 decimal places?"
    }
  ],
  "answers": [
    {
      "type": "AnswerMultipleChoice",
      "options": ["3.12", "3.14", "3.16", "3.18"],
      "correct": 1
    }
  ]
}
```

### Key Principles

1. **Direct Properties**: Layout properties and component arrays are direct properties of the content object
2. **Layout Properties**: Properties defined by the layout component (title, subtitle, etc.)
3. **Component Arrays**: Arrays of components, conventionally named "components" but can be any name
4. **Multiple Sections**: Layouts can define multiple component arrays (e.g., "questions", "answers")
5. **Type Validation**: All properties validated against the ContentType's generated schema

## Description Best Practices

Content descriptions follow a structured format for semantic search:

```markdown theme={null}
[Title or headline]. [Brief summary of the content].

**Topics:** [Main topics covered]
**Key points:** [Primary takeaways]
**Length:** [Word count or duration]
**Language:** [Content language]
```

<Note>
  Aim for 250-350 characters. Maximum is 500 characters.
</Note>
