Налаштування Blueprints та Fieldsets Statamic
Blueprints — схеми полів для Collections, Globals, Taxonomies, Users. Fieldsets — переиспользуемые групи полів, які імпортуються в Blueprints.
Blueprint
# resources/blueprints/collections/blog/post.yaml
title: Post
sections:
main:
display: Main
fields:
- handle: title
field:
type: text
required: true
display: Заголовок
instructions: Використовується як H1 та og:title
- handle: content
field:
type: bard
display: Вміст
sets:
article_sets:
display: Article
sets:
pull_quote:
display: Pull Quote
fields:
- handle: quote
field: { type: text }
- handle: attribution
field: { type: text }
code_block:
display: Code Block
fields:
- handle: language
field:
type: select
options: [php, javascript, python, bash, yaml, json]
- handle: code
field: { type: code }
- handle: featured_image
field:
type: assets
container: assets
max_files: 1
display: Головне зображення
validate: [image]
sidebar:
display: Sidebar
fields:
- handle: categories
field:
type: terms
taxonomies: [categories]
max_items: 3
- handle: author
field:
type: users
max_items: 1
- import: seo
prefix: seo_
Fieldset — переиспользуемые поля
# resources/fieldsets/seo.yaml
title: SEO
fields:
- handle: title
field:
type: text
display: SEO Title
instructions: Якщо пусто — використовується основний заголовок
character_limit: 70
- handle: description
field:
type: textarea
display: Meta Description
character_limit: 160
- handle: og_image
field:
type: assets
container: assets
max_files: 1
display: OG Image
instructions: 1200×630px, використовується в соцмережах
validate: [image]
- handle: canonical_url
field:
type: text
display: Canonical URL
instructions: Залишите пусто для автоматичної canonical
- handle: noindex
field:
type: toggle
display: Приховати від пошукових систем
default: false
Імпорт Fieldset в Blueprint:
# У секції Blueprint
- import: seo # поля без префіксу
- import: seo # з префіксом
prefix: seo_
Типи полів Statamic
| Тип | Опис |
|---|---|
text |
Рядок |
textarea |
Багаторядковий текст |
bard |
Rich text (ProseMirror) з кастомними наборами |
markdown |
Markdown-редактор |
code |
Поле з підсвіткою коду |
assets |
Файли/зображення |
entries |
Посилання на записи інших колекцій |
terms |
Посилання на таксономії |
users |
Посилання на користувачів |
date |
Дата/час |
time |
Час |
toggle |
Перемикач |
select / radio / checkboxes |
Варіанти вибору |
color |
Колір |
range |
Діапазон |
table |
Редагована таблиця |
replicator |
Повторюючі набори полів |
grid |
Повторюючі рядки |
link |
Внутрішні/зовнішні посилання |
video |
URL відео (YouTube/Vimeo embed) |
yaml |
Довільний YAML |
Налаштування Blueprints для 5–8 колекцій з переиспользуемыми Fieldsets — 1–2 дні.







