Field Types
FrankenCMS provides a comprehensive set of field types for building dynamic templates.
Text Fields
@frankenText
Single-line text input for titles, labels, and short content:
@frankenText('page.headline', [
'label' => 'Page Headline',
'default' => 'Welcome to our site',
'maxLength' => 100,
'placeholder' => 'Enter a title...',
'required' => true,
])
@frankenTextarea
Multi-line text input for descriptions and longer content:
@frankenTextarea('hero.description', [
'label' => 'Hero Description',
'default' => '',
'rows' => 4,
'maxLength' => 500,
])
@frankenRichEditor
WYSIWYG editor for formatted content:
@frankenRichEditor('page.content', [
'label' => 'Page Content',
'default' => '<p>Start writing...</p>',
])
Media Fields
@frankenImage
Image upload with media library integration:
@frankenImage('page.heroImage', [
'label' => 'Hero Background Image',
'collection' => 'hero-images',
])
<img src="{{ frankenField('page.heroImage') }}" alt="">
@frankenFile
File upload for documents and other files:
@frankenFile('resources.pdf', [
'label' => 'Resource PDF',
'acceptedFileTypes' => ['application/pdf'],
])
Selection Fields
@frankenSelect
Dropdown selection:
@frankenSelect('layout.style', [
'label' => 'Layout Style',
'options' => [
'default' => 'Default',
'wide' => 'Wide',
'narrow' => 'Narrow',
],
'default' => 'default',
])
@frankenToggle
Boolean on/off switch:
@frankenToggle('features.showCta', [
'label' => 'Show Call to Action',
'default' => true,
])
@if(frankenField('features.showCta'))
<div class="cta">...</div>
@endif
@frankenCheckboxList
Multiple checkbox selection:
@frankenCheckboxList('features.enabled', [
'label' => 'Enabled Features',
'options' => [
'analytics' => 'Analytics',
'comments' => 'Comments',
'sharing' => 'Social Sharing',
],
])
Specialized Fields
@frankenColor
Color picker:
@frankenColor('branding.primary', [
'label' => 'Primary Color',
'default' => '#10b981',
])
<style>
:root { --primary: {{ frankenField('branding.primary') }}; }
</style>
@frankenLink
URL input with validation:
@frankenLink('cta.url', [
'label' => 'CTA Link',
'default' => '/',
])
Common Options
All field types support these common options:
| Option | Type | Description |
|---|---|---|
label |
string | Display label in admin |
default |
mixed | Default value |
required |
bool | Whether field is required |
helperText |
string | Help text shown below field |