text
複数行のプレーンテキスト入力用フィールドです。説明文、メモ、コードなど、書式設定が不要な長いテキストに適しています。
基本例
{
"name": "description",
"type": "text",
"label": "説明"
} プロパティ
| プロパティ | 型 | 必須 | 説明 |
|---|---|---|---|
name | string | Yes | フィールドの識別子 |
type | "text" | Yes | "text"を指定 |
label | string | No | CMS上での表示名 |
note | string | No | 編集者向けの補足メモ |
required | boolean | No | 必須フィールドかどうか |
default | string | No | デフォルト値 |
minLength | number | No | 最小文字数 |
maxLength | number | No | 最大文字数 |
使用例
説明文
{
"name": "description",
"type": "text",
"label": "説明",
"maxLength": 500
} 自己紹介
{
"name": "bio",
"type": "text",
"label": "自己紹介",
"note": "簡単な自己紹介を入力してください",
"maxLength": 1000
} コードスニペット
{
"name": "code",
"type": "text",
"label": "コード",
"note": "プレーンテキストとして保存されます"
} 文字数制限付き
{
"name": "excerpt",
"type": "text",
"label": "抜粋",
"minLength": 50,
"maxLength": 200,
"note": "50〜200文字で記事の要約を入力してください"
} richtextとの違い
| フィールド | 用途 | 書式設定 | 保存形式 |
|---|---|---|---|
text | プレーンテキスト | なし | そのまま |
richtext | リッチテキスト | あり(見出し、リスト等) | HTML/Markdown |
書式設定(太字、リスト、見出しなど)が必要な場合はrichtextを使用してください。