Skip to content

Field Types

Phillip Dornauer edited this page Apr 1, 2026 · 1 revision

Field Types

Marble includes 17 built-in field types. Each is configured per blueprint field.


Text Fields

textfield — Text Field

Single-line text input.

{{ $item->value('title') }}

textblock — Text Block

Multi-line plain text (textarea).

{{ $item->value('summary') }}
{{-- Preserve line breaks: --}}
{!! nl2br(e($item->value('summary'))) !!}

htmlblock — HTML Block

WYSIWYG rich text editor (CKEditor). Stores HTML.

{!! $item->value('content') !!}

Configuration options:

  • toolbar — Toolbar preset: 'full', 'basic'

Supports internal node-link placeholders ({% node-link:42 %}) which are automatically resolved to item URLs when rendered.

Not available in contact forms.


Selection Fields

selectbox — Select Box

Dropdown select list.

{{ $item->value('category') }}

Configuration options:

  • options — Array of { key, value } pairs
  • multipletrue to allow multiple selections (returns array)

checkbox — Checkbox

Boolean toggle. Stores '1' (checked) or '0' (unchecked).

@if($item->value('featured'))
    <span class="badge">Featured</span>
@endif

Date & Time Fields

date — Date

Date picker. Returns YYYY-MM-DD.

{{ \Carbon\Carbon::parse($item->value('publish_date'))->format('d.m.Y') }}

datetime — Date & Time

Returns a structured array: ['date' => '...', 'time' => '...'].


time — Time

Returns a structured array: ['hour' => '...', 'minute' => '...'].


Media Fields

image — Image

Single image with media library picker, focal point and transformations.

@php $img = $item->value('cover_image'); @endphp
@if($img)
    <img src="{{ $img->url(800, 600) }}" alt="{{ $item->name() }}">
@endif

URL sizing:

$img->url()           // Original
$img->url(800)        // Width 800, proportional height
$img->url(800, 600)   // Cover crop to 800×600
$img->url(0, 400)     // Height 400, proportional width

images — Image Gallery

Multiple images with drag-to-reorder.

@foreach($item->value('gallery') as $img)
    <img src="{{ $img->url(400, 300) }}" alt="">
@endforeach

file — File

Single file upload. Returns ['url', 'original_filename', 'size', 'mime_type'].

Configuration options:

  • allowed_filetypes — Comma-separated extensions (e.g. pdf,docx)

files — Files

Multiple file uploads with reordering.

Configuration options:

  • allowed_filetypes — Comma-separated extensions

Relation Fields

object_relation — Object Relation

Reference to a single other item. Returns the full Item object.

@php $author = $item->value('author'); @endphp
@if($author)
    <a href="{{ Marble::url($author) }}">{{ $author->name() }}</a>
@endif

Configuration options:

  • on_delete'detach' or 'cascade'

object_relation_list — Object Relation List

References to multiple items. Returns an array of Item objects.

Configuration options:

  • on_delete'detach' or 'cascade'

Advanced Fields

repeater — Repeater

Repeating group of sub-fields. Returns an array of associative arrays.

@foreach($item->value('features') as $feature)
    <h3>{{ $feature['title'] ?? '' }}</h3>
    <p>{{ $feature['description'] ?? '' }}</p>
@endforeach

keyvalue_store — Key/Value Store

Flexible key-value pairs. Returns a stdClass object.

@foreach((array)$item->value('metadata') as $key => $value)
    <dt>{{ $key }}</dt><dd>{{ $value }}</dd>
@endforeach

Field Type Availability in Forms

Fields marked ✓ can be used in blueprints with Is Form enabled:

Field Type In Forms
textfield
textblock
htmlblock
selectbox
checkbox
date
datetime
time
image
file
object_relation
object_relation_list
repeater
keyvalue_store

Clone this wiki locally