How do I enable the CMS and create my first content model?
5 分钟阅读初级
Before you can create content, you need to enable the Content CMS on your project and define a content model.
Step 1: Enable Content CMS
- Go to your project → Integrations tab
- Find the Content CMS card
- Click Enable
Once enabled, you'll see the Content CMS management page with sections for models and API keys.
Step 2: Create a content model
A model defines the structure of your content — what fields each entry will have.
- Click "Create model"
- Fill in:
- Model name — display name (e.g., "Blog Post")
- Slug — URL identifier, auto-generated from name (e.g.,
blog-post) - Description — what this model is for
- Icon — choose an icon for the model
- Kind — Collection (many entries) or Singleton (one entry)
- Click Create
Collection vs. Singleton
| Kind | Use case | Example |
|---|---|---|
| Collection | Many entries of the same type | Blog posts, help articles, FAQs |
| Singleton | One entry only | Homepage hero, site settings, footer content |
Step 3: Add fields
After creating the model, go to the Fields tab to add custom fields:
- Click "Add field"
- Choose a field type:
| Type | Description | Example |
|---|---|---|
| Text | Short text string | Subtitle, author name |
| Textarea | Multi-line text | Excerpt, description |
| Number | Numeric value | Reading time, order |
| Boolean | True/false toggle | Is featured, is published |
| Enum | Dropdown selection | Category, difficulty level |
| Relation | Link to another model's entry | Author → Users, Category → Categories |
| Media | Image or file URL | Featured image, thumbnail |
- Configure the field:
- Name — field identifier (used in API responses)
- Display name — human-readable label
- Localizable — whether this field should be translated per language
- Required — whether this field must have a value
- Help text — hint shown to content editors
- Click Save
Step 4: Enable the body field
By default, models include a body field for rich text content (Markdown). This is enabled when the model's includeBody setting is true. The body field supports:
- Markdown formatting
- Code blocks with syntax highlighting
- Tables
- Images
- Links
Example: Blog post model
A typical blog post model might have:
- Body — main article content (built-in)
- Excerpt (textarea, localizable) — short summary for cards
- Author (relation → users) — who wrote it
- Category (enum: tech, product, company) — categorization
- Featured image (text) — hero image URL
- Reading time (number) — estimated minutes to read
- Is featured (boolean) — show on homepage