項目の型の一覧
この記事の内容
型の一覧
項目のtype)はbodyField のdata の
| 型 | 管理画面での |
用途 | エントリーファイルでの |
API での |
|---|---|---|---|---|
text |
テキスト | 1 行の |
title: 新機能のお知らせ |
{ "text": "…", "html": "…" }(phraseBreak: false なら |
textarea |
複数行 | 複数行の |
summary: 1 行目 に| の |
text と |
richtext |
Markdown | Markdown の |
bodyField なら| の |
{ "markdown": "…", "html": "…" } |
number |
数値 | 数 | position: 10 |
数値 |
boolean |
真偽 | は |
featured: true |
true / false |
date |
日付 | 日付 | day: 2026-01-02 |
"2026-01-02" |
datetime |
日時 | 日時 | start: 2026-01-02T03:04:05+09:00 |
UTC の"2026-01-01T18:04:05Z" |
select |
選択 | 選択肢から |
audience: [editor, admin] |
文字列multiple なら |
url |
URL | リンク先 | link: https://example.com |
文字列 |
slug |
slug | URL に |
slug: field-types |
文字列 |
media |
メディア | 画像 | cover: media/2026/hero.png |
{ path, url, mimeType, width, height, alt }(multiple なら |
reference |
参照 | 別の |
section: <エントリーの ID> |
{ id, type, slug }。depth でdata も |
repeater |
繰り返し | 項目の |
組の |
組の |
icon |
アイコン | アイコンの |
icon: solid:house |
文字列 |
値がmultiple のrepeater は[]、null に
共通の設定
どの
| キー | 内容 |
|---|---|
key |
項目の |
label |
管理画面に |
type |
型 |
required |
true で |
help |
管理画面の |
indexed |
true にfilter とorder で |
unique |
true に |
phraseBreak |
text、textarea、richtext でtrue(文節での |
options |
型ごとの |
unique をtext、slug、number、url のslug 型のslugField にunique をindexed とunique のslugField の
エントリーのlabel にmultiple の
text・textarea・richtext
文字列をoptions.maxLength で
| options | 内容 |
|---|---|
maxLength |
最大文字数 |
検証メッセージは1.10 が1.1 には
text はhtml ではtextarea は<br> にphraseBreak がtrue なら、text(元のhtml(文節の<wbr> をfalse に
richtext で使える Markdown と HTML
richtext はmarkdown(書いたまま)とhtml(変換後)を
Markdown の
| 種類 | 許可される |
|---|---|
| タグ | h1〜h6、p、br、strong、em、s、del、a、ul、ol、li、blockquote、code、pre、hr、img、table、thead、tbody、tr、th、td、mark、span、small、sup、sub、input、wbr |
| 属性 | すべてのclass とtitle。a のhref、img のsrc とalt、th とtd のalign。input は、type="checkbox"、disabled、checked だけ |
リンク先href) |
http、https、mailto、/ で#)。javascript: や// で |
画像src) |
https:// でmedia/ の.. を |
script とstyle はonclick のようなon でstyle 属性、a のtarget など)も
本文の のように、html では、
管理画面の## と###)、
number
数値です。options で
| options | 内容 |
|---|---|
integer |
true で |
min |
最小値 |
max |
最大値 |
検証メッセージは"10" のような
boolean
true かfalse です。false はrequired でもfalse は
date・datetime
date は2026-01-02 の
datetime は
- 時刻を
書く ときは、 Z(UTC)か+09:00のような時差が 必須です。 時差が ないと、 サーバーの 時刻設定に 左右される ため、 「日時の 形式が 正しく ありません (例: 2026-01-02T03:04:05+09:00)」で 拒否されます。 秒は 省略できます。 - 日付だけ
( 2026-01-02)を書くと、 UTC の 0 時 ( 2026-01-02T00:00:00Z)として 扱います。 日本時間の 0 時には なりません。 - 値は
UTC に 直して、 API に 返します。 2026-01-02T03:04:05+09:00は2026-01-01T18:04:05Zです。
日本時間で
select
選択肢からoptions.choices は
| options | 内容 |
|---|---|
choices |
選択肢の |
multiple |
true で |
選択肢に
url・slug
url は、http://、https://、mailto:、/about)、#top)で
slug は、field-types)。slugField にslug 型の
media
メディアにmedia/2026/hero.png)をmedia/ で
| options | 内容 |
|---|---|
multiple |
true で |
mime |
受け付ける["image/png", "image/jpeg"]、image/* も |
API は、url、mimeType、width、height、alt をnull に、multiple なら
reference
別の
| options | 内容 |
|---|---|
refType |
参照先の |
multiple |
true で |
参照先のid の/admin/content/<種類のキー>/<ID>)に、content/<種類のキー> のid に
ID のrefType の
API はid、type、slug をdepth(0〜2、data も
repeater
項目のoptions.fields に、
{
"key": "faq",
"label": "よくある質問",
"type": "repeater",
"options": {
"fields": [
{ "key": "q", "label": "質問", "type": "text", "required": true },
{ "key": "a", "label": "答え", "type": "textarea" }
]
}
}faq:
- q: 料金はいくらですか
a: 無料プランがあります。
- q: 解約できますか
a: いつでもできます。制約は
| 制約 | メッセージ |
|---|---|
| 子は |
「repeater の |
| repeater の |
「repeater の |
| repeater の |
「repeater の |
子にunique は |
「repeater の |
子のindexed は
icon
アイコンのsolid:、regular:、brands: の: のsolid:house、brands:github)。
Kumidana が