|
| 1 | +--- |
| 2 | +name: cms-best-practices |
| 3 | +description: Expert guidance on Webflow CMS architecture and best practices. Use when planning collections, setting up relationships, optimizing content structure, or troubleshooting CMS issues. |
| 4 | +--- |
| 5 | + |
| 6 | +# CMS Best Practices |
| 7 | + |
| 8 | +Provide expert guidance on Webflow CMS architecture, relationships, and optimization. |
| 9 | + |
| 10 | +## Instructions |
| 11 | + |
| 12 | +1. **Understand the use case**: What content is being managed and how will it be displayed? |
| 13 | +2. **Recommend structure**: Suggest collections, fields, and relationships |
| 14 | +3. **Explain tradeoffs**: Help users understand limitations and workarounds |
| 15 | +4. **Optimize for scale**: Consider performance with large datasets |
| 16 | + |
| 17 | +## Collection Architecture |
| 18 | + |
| 19 | +### When to Use CMS vs Static |
| 20 | + |
| 21 | +**Use CMS when:** |
| 22 | +- Content updates frequently |
| 23 | +- Multiple similar items (blog posts, products, team members) |
| 24 | +- Non-technical users need to edit content |
| 25 | +- Content needs filtering/sorting on the frontend |
| 26 | +- Same content appears on multiple pages |
| 27 | + |
| 28 | +**Use Static when:** |
| 29 | +- Content rarely changes |
| 30 | +- Unique one-off sections |
| 31 | +- Complex custom layouts per item |
| 32 | +- No need for dynamic filtering |
| 33 | + |
| 34 | +### Field Type Selection |
| 35 | + |
| 36 | +| Content Type | Recommended Field | Notes | |
| 37 | +|--------------|-------------------|-------| |
| 38 | +| Short text (<256 chars) | Plain Text | Titles, names, slugs | |
| 39 | +| Long text (no formatting) | Plain Text (long) | Descriptions, excerpts | |
| 40 | +| Formatted content | Rich Text | Blog content, bios | |
| 41 | +| Single image | Image | Photos, thumbnails | |
| 42 | +| Multiple images | Multi-image | Galleries | |
| 43 | +| File downloads | File | PDFs, documents | |
| 44 | +| Yes/No values | Switch | Featured flags, visibility | |
| 45 | +| Single choice | Option | Status, category type | |
| 46 | +| Date/time | Date/Time | Publish dates, events | |
| 47 | +| Link to other item | Reference | Author → Post | |
| 48 | +| Link to multiple items | Multi-reference | Post → Tags | |
| 49 | +| External URL | Link | Social links, external resources | |
| 50 | +| Numeric values | Number | Prices, ratings, order | |
| 51 | +| Color values | Color | Theme colors, accents | |
| 52 | + |
| 53 | +## Relationship Patterns |
| 54 | + |
| 55 | +### One-to-Many (Reference Field) |
| 56 | + |
| 57 | +**Example:** Posts → Author |
| 58 | +``` |
| 59 | +Authors Collection: |
| 60 | +├── name (Text) |
| 61 | +├── bio (Rich Text) |
| 62 | +└── photo (Image) |
| 63 | +
|
| 64 | +Posts Collection: |
| 65 | +├── title (Text) |
| 66 | +├── content (Rich Text) |
| 67 | +└── author (Reference → Authors) ← Each post has ONE author |
| 68 | +``` |
| 69 | + |
| 70 | +**Display:** On post page, access `author.name`, `author.photo` |
| 71 | + |
| 72 | +### Many-to-Many (Multi-Reference) |
| 73 | + |
| 74 | +**Example:** Posts ↔ Tags |
| 75 | +``` |
| 76 | +Tags Collection: |
| 77 | +├── name (Text) |
| 78 | +└── slug (Text) |
| 79 | +
|
| 80 | +Posts Collection: |
| 81 | +├── title (Text) |
| 82 | +├── content (Rich Text) |
| 83 | +└── tags (Multi-Reference → Tags) ← Each post has MANY tags |
| 84 | +``` |
| 85 | + |
| 86 | +**Limitations:** |
| 87 | +- Max 5 multi-reference fields per collection |
| 88 | +- Can only filter by ONE multi-reference value at a time |
| 89 | +- Cannot sort by referenced field values |
| 90 | + |
| 91 | +### Nested Collections Pattern |
| 92 | + |
| 93 | +For hierarchical content (Categories → Subcategories): |
| 94 | +``` |
| 95 | +Categories Collection: |
| 96 | +├── name (Text) |
| 97 | +├── slug (Text) |
| 98 | +└── parent (Reference → Categories) ← Self-reference for hierarchy |
| 99 | +``` |
| 100 | + |
| 101 | +**Alternative:** Use Option field for simple categorization instead. |
| 102 | + |
| 103 | +## Examples |
| 104 | + |
| 105 | +**User prompt:** |
| 106 | +``` |
| 107 | +I'm building a recipe site. How should I structure the CMS? |
| 108 | +``` |
| 109 | + |
| 110 | +**Response format:** |
| 111 | +``` |
| 112 | +📐 CMS Architecture: Recipe Site |
| 113 | +
|
| 114 | +Collections needed: |
| 115 | +
|
| 116 | +1. Recipes (main content) |
| 117 | +├── name (Text, required) |
| 118 | +├── slug (Text, required) |
| 119 | +├── description (Plain Text) |
| 120 | +├── featured-image (Image) |
| 121 | +├── prep-time (Number) - minutes |
| 122 | +├── cook-time (Number) - minutes |
| 123 | +├── servings (Number) |
| 124 | +├── difficulty (Option: Easy, Medium, Hard) |
| 125 | +├── ingredients (Rich Text) |
| 126 | +├── instructions (Rich Text) |
| 127 | +├── author (Reference → Authors) |
| 128 | +├── category (Reference → Categories) |
| 129 | +├── tags (Multi-Reference → Tags) |
| 130 | +├── featured (Switch) |
| 131 | +└── publish-date (Date) |
| 132 | +
|
| 133 | +2. Categories |
| 134 | +├── name (Text) |
| 135 | +├── slug (Text) |
| 136 | +├── description (Plain Text) |
| 137 | +└── image (Image) |
| 138 | +
|
| 139 | +3. Tags |
| 140 | +├── name (Text) |
| 141 | +└── slug (Text) |
| 142 | +
|
| 143 | +4. Authors |
| 144 | +├── name (Text) |
| 145 | +├── bio (Rich Text) |
| 146 | +├── photo (Image) |
| 147 | +└── social-link (Link) |
| 148 | +
|
| 149 | +Relationships: |
| 150 | +- Recipe → Author (one-to-many) |
| 151 | +- Recipe → Category (one-to-many) |
| 152 | +- Recipe → Tags (many-to-many) |
| 153 | +
|
| 154 | +Recommended pages: |
| 155 | +- /recipes (Collection List with filters) |
| 156 | +- /recipes/[slug] (Collection Page) |
| 157 | +- /categories/[slug] (filtered recipe list) |
| 158 | +- /authors/[slug] (author profile + their recipes) |
| 159 | +``` |
| 160 | + |
| 161 | +**User prompt:** |
| 162 | +``` |
| 163 | +My collection list is slow with 500+ items. How do I optimize? |
| 164 | +``` |
| 165 | + |
| 166 | +**Response format:** |
| 167 | +``` |
| 168 | +⚡ CMS Performance Optimization |
| 169 | +
|
| 170 | +Current issue: Loading 500+ items impacts page speed. |
| 171 | +
|
| 172 | +Recommendations: |
| 173 | +
|
| 174 | +1. **Pagination** |
| 175 | + - Limit collection list to 12-20 items |
| 176 | + - Add "Load More" button or page navigation |
| 177 | + - Use Webflow's built-in pagination |
| 178 | +
|
| 179 | +2. **Lazy loading images** |
| 180 | + - Set images to load="lazy" |
| 181 | + - Use appropriate image sizes (not full resolution) |
| 182 | +
|
| 183 | +3. **Reduce reference field lookups** |
| 184 | + - Each reference field = additional query |
| 185 | + - Consider denormalizing (copy author name to post) |
| 186 | + - Only include reference fields you display |
| 187 | +
|
| 188 | +4. **Filter at collection level** |
| 189 | + - Don't load all items then hide with conditions |
| 190 | + - Use collection list filters to limit results |
| 191 | +
|
| 192 | +5. **Consider static for archives** |
| 193 | + - Recent 50 items: dynamic CMS |
| 194 | + - Older content: static archive pages |
| 195 | +
|
| 196 | +Quick wins: |
| 197 | +├── Limit to 20 items per page ✓ |
| 198 | +├── Enable pagination ✓ |
| 199 | +├── Remove unused reference bindings ✓ |
| 200 | +└── Optimize image sizes ✓ |
| 201 | +``` |
| 202 | + |
| 203 | +## Common Questions |
| 204 | + |
| 205 | +### "How many collections can I have?" |
| 206 | +- Starter: 1 collection, 50 items |
| 207 | +- Basic: 2 collections, 200 items |
| 208 | +- CMS: 20 collections, 2,000 items |
| 209 | +- Business: 40 collections, 10,000 items |
| 210 | +- Enterprise: Custom limits |
| 211 | + |
| 212 | +### "Can I filter by multiple tags?" |
| 213 | +Not directly. Workarounds: |
| 214 | +1. Create combined tag (e.g., "vegan-gluten-free") |
| 215 | +2. Use Finsweet CMS Filter for client-side filtering |
| 216 | +3. Create separate filtered collection lists |
| 217 | + |
| 218 | +### "How do I reorder items?" |
| 219 | +1. Add a Number field called "order" or "sort-order" |
| 220 | +2. Set collection list to sort by that field |
| 221 | +3. Update numbers to change order |
| 222 | + |
| 223 | +### "Can I schedule posts?" |
| 224 | +Yes! Use a Date field for "publish-date" and: |
| 225 | +1. Filter collection list: Publish Date < Today |
| 226 | +2. Items with future dates won't show |
| 227 | + |
| 228 | +### "Should I use Rich Text or separate fields?" |
| 229 | +- **Rich Text:** Flexible content, blog posts, articles |
| 230 | +- **Separate fields:** Structured data you need to style individually |
| 231 | + |
| 232 | +## Guidelines |
| 233 | + |
| 234 | +- Plan collection structure before building pages |
| 235 | +- Use descriptive field names (not "text-1", "image-2") |
| 236 | +- Add help text to fields for content editors |
| 237 | +- Set required fields for essential data |
| 238 | +- Use Option fields instead of free text for controlled values |
| 239 | +- Create test items before building collection templates |
| 240 | +- Consider URL structure early (/blog/[slug] vs /posts/[slug]) |
| 241 | +- Document your CMS structure for team members |
| 242 | + |
0 commit comments