Appearance
Schemas in Kantan CMS
What are Schemas?
Schemas in Kantan CMS define the structure and data types for your collections. They allow you to create custom fields tailored to your specific content needs, giving you complete control over how your data is organized and presented.
A schema consists of field definitions that determine:
- What information can be stored in a record
- What data types are used for each field
- How the information is validated and processed
- How the content is presented in the editing interface
With schemas, you can transform generic collections into specialized content structures perfectly suited to your website's requirements.
Managing Schemas
To access and manage schemas for a collection:
- Navigate to the specific collection
- Click on "Edit Schema" in the collection options
- You'll see the current schema structure for the collection
Adding a New Schema Field
To add a new field to your collection's schema:
- In the schema editor, click "Add Schema"
- Fill in the field details:
- Name: Human-readable label for the field
- Custom Key: Unique identifier used in the database and API (no spaces, lowercase)
- Description: Optional explanation of the field's purpose
- Field Type: Select from available data types (see below)
- Configure any type-specific options
- Save the new field
Editing an Existing Schema Field
To modify an existing schema field:
- In the schema editor, locate the field you want to edit
- Click the pen (edit) button next to the field
- Update the field properties as needed
- Save your changes
Schema Field Types
Kantan CMS offers a variety of field types to accommodate different content needs:
Text Field Types
- Short Text: For titles, names, and brief text entries
- Long Text: For paragraphs and extended content
- Rich Text/Markdown: For formatted content with styling
- HTML: For direct HTML content
Numeric Field Types
- Number: For integer or decimal values
- Currency: For monetary values with currency formatting
Selection Field Types
- Dropdown: Single selection from predefined options
- Multi-select: Multiple selections from predefined options
- Tags: Flexible keyword or category assignments
Media Field Types
- Image: For image file uploads with preview
- File: For document or other file uploads
- Media Reference: For linking to existing media in your library
Best Practices for Schema Design
When designing schemas for your collections, consider these recommendations:
- Plan your structure: Before creating fields, map out what information you need to store and how it will be used
- Use descriptive names: Choose clear, meaningful names for your fields
- Be consistent: Maintain naming conventions across collections
- Start simple: Begin with essential fields and add more as needed
Well-designed schemas form the foundation of an effective content management system, enabling efficient content creation and powerful content delivery.