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:

blade
@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:

blade
@frankenTextarea('hero.description', [
    'label' => 'Hero Description',
    'default' => '',
    'rows' => 4,
    'maxLength' => 500,
])

@frankenRichEditor

WYSIWYG editor for formatted content:

blade
@frankenRichEditor('page.content', [
    'label' => 'Page Content',
    'default' => '<p>Start writing...</p>',
])

Media Fields

@frankenImage

Image upload with media library integration:

blade
@frankenImage('page.heroImage', [
    'label' => 'Hero Background Image',
    'collection' => 'hero-images',
])


&lt;img src="{{ frankenField('page.heroImage') }}" alt=""&gt;

@frankenFile

File upload for documents and other files:

blade
@frankenFile('resources.pdf', [
    'label' => 'Resource PDF',
    'acceptedFileTypes' => ['application/pdf'],
])

Selection Fields

@frankenSelect

Dropdown selection:

blade
@frankenSelect('layout.style', [
    'label' => 'Layout Style',
    'options' => [
        'default' => 'Default',
        'wide' => 'Wide',
        'narrow' => 'Narrow',
    ],
    'default' => 'default',
])

@frankenToggle

Boolean on/off switch:

blade
@frankenToggle('features.showCta', [
    'label' => 'Show Call to Action',
    'default' => true,
])

@if(frankenField('features.showCta'))
    <div class="cta">...</div>
@endif

@frankenCheckboxList

Multiple checkbox selection:

blade
@frankenCheckboxList('features.enabled', [
    'label' => 'Enabled Features',
    'options' => [
        'analytics' => 'Analytics',
        'comments' => 'Comments',
        'sharing' => 'Social Sharing',
    ],
])

Specialized Fields

@frankenColor

Color picker:

blade
@frankenColor('branding.primary', [
    'label' => 'Primary Color',
    'default' => '#10b981',
])

<style>
    :root { --primary: {{ frankenField('branding.primary') }}; }
</style>

@frankenLink

URL input with validation:

blade
@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

Next Steps