Tipe Field
Semua tipe field native Tina udah ditest end-to-end (data layer + form editor + contextual editing) sama nuxt-tina. Tabel ini ringkasannya: buat detail lengkap tiap tipe, lihat dokumentasi field Tina sendiri.
| Field | type | Plugin (ui.component) |
|---|---|---|
| Text | string | "text" (default) |
| Text Area | string | "textarea" |
| Number | number | "number" (default) |
| Date | datetime | "date" (default) |
| Toggle | boolean | "toggle" (default) |
| Image | image | "image" (default) |
| Color | string | "color": butuh colorFormat: 'hex' | 'rgb' |
| Radio Group | string + options | "radio-group" |
| Select | string + options | "select" (default kalau options diset) |
| Tags | string + list: true | "tags" (default) |
| Reference | reference + collections: [...] | - |
| Group | object | "group" (default) |
| Group List | object + list: true | "group-list" (default) |
| Rich-text | rich-text | - (lihat Rich-Text Lanjutan) |
Contoh lengkap
{
type: 'string',
name: 'accentColor',
label: 'Accent Color',
ui: { component: 'color', colorFormat: 'hex' },
}
{
type: 'string',
name: 'visibility',
label: 'Visibility',
options: ['public', 'unlisted', 'private'],
ui: { component: 'radio-group' },
}
{
type: 'reference',
name: 'author',
label: 'Author',
collections: ['author'], // nama collection target
}
Query GraphQL-nya otomatis nge-inline dokumen yang direferensikan:
{ "author": { "name": "...", "bio": "...", "avatar": null } }
⚠️ Limitasi: picker reference nampilin nama file, bukan judul
Combobox field reference di admin selalu nampilin _sys.filename dokumen yang dipilih: bukan value field isTitle-nya (misal name). Ini bukan kesalahan config: fungsi internal tinacms yang generate label itu (getFilename) hardcoded ke filename, nggak ada hook itemProps buat override tampilan combobox ini. Nggak ada yang bisa dibenerin dari sisi tina/config.ts.
Nama plugin yang gampang salah
ui.component harus PAS nama plugin resminya: typo nggak bikin error, cuma diam-diam balik ke default. Yang paling gampang salah:
'radio-group', bukan'radio''group-list', bukan'group_list'atau'grouplist'
Kalau field-nya nggak dirender sesuai harapan meskipun ui.component udah diset, cek lagi nama plugin-nya dibandingin dokumentasi resmi Tina.