Architects
This guide covers strategies for designing effective content models in Agility CMS, including when to use different model types and how to structure relationships.
This guide covers strategies for designing effective content models in Agility CMS, including when to use different model types and how to structure relationships.
Agility CMS supports two content model types:
Characteristics:
Use When:
Characteristics:
Use When:
Ask: Will this content be used in multiple places?
Example:
Ask: Does this content relate to other content?
Example:
Ask: Do you need to query/filter this content?
Example:
Ask: Does this content need personalization?
Example:
Use For:
Use For:
Use For:
Use For:
Use For:
Use For:
Use For:
Pattern: One content item links to one other item
Example: Post → Author
Implementation:
interface IPost {
author: ContentItem<IAuthor>
}
Pattern: One content item links to multiple items
Example: Post → Tags
Implementation:
interface IPost {
tags: ContentItem<ITag>[]
}
Pattern: Multiple items link to multiple items
Example: Post ↔ Tags
Implementation:
interface IPost {
tags: ContentItem<ITag>[]
}
interface ITag {
// Tags reference posts via reverse relationship
}
Pattern: Parent component references child content list
Example: BentoSection → BentoCards
Implementation:
interface IBentoSection {
bentoCards: { referencename: string }
}
// Fetch children separately
const cards = await getContentList({
referenceName: referencename
})
Organize content hierarchically:
Organize content flatly:
Next: Component Strategy - Component architecture