Blade Directives

FrankenCMS extends Laravel's Blade with custom directives for content rendering, menus, SEO, and more.

Template Field Directives

Directive Description
@frankenText Single-line text input
@frankenTextarea Multi-line text input
@frankenRichEditor WYSIWYG rich text editor
@frankenImage Image upload field
@frankenFile File upload field
@frankenToggle Boolean toggle switch
@frankenSelect Dropdown selection
@frankenRepeater Repeatable content blocks

Content Directives

@menu

Render a navigation menu by slug:

blade
@menu('main-navigation')


@menu('main-navigation', 'theme.partials.nav')

@posts

Loop through published posts:

blade
@posts(['limit' => 5, 'category' => 'news'])
    <article>
        <h2><a href="{{ $post->url }}">{{ $post->title }}</a></h2>
        <p>{{ $post->teaser }}</p>
    </article>
@endposts

@pages

List pages:

blade
@pages(['parent' => 'about'])
    <li><a href="{{ $page->url }}">{{ $page->title }}</a></li>
@endpages

SEO Directives

@seoHead

Output all SEO meta tags:

resources/views/theme/layouts/app.blade.php
<head>
    @seoHead
</head>

This outputs:

  • Title tag
  • Meta description
  • Canonical URL
  • Open Graph tags
  • Twitter Card tags
  • JSON-LD structured data

@seoTitle

Output just the SEO title:

blade
<title>@seoTitle</title>

Utility Directives

@breadcrumbs

Display breadcrumb navigation:

blade
@breadcrumbs


@breadcrumbs('theme.partials.breadcrumbs')

@siteSetting

Access a site setting value:

blade
<h1>@siteSetting('site_name')</h1>


<p>@siteSetting('tagline', 'Welcome to our site')</p>

Helper Functions

In addition to directives, FrankenCMS provides helper functions:

blade
{{ frankenField('hero.title') }}
{{ frankenField('hero.title', 'Default Title') }}


{{ siteSetting('site_name') }}


{{ currentContent()-&gt;title }}

Conditional Directives

blade
@isPage('home')
    <div class="home-specific">...</div>
@endIsPage


@isPost
    <div class="post-meta">...</div>
@endIsPost


@hasRole('editor')
    <a href="/admin">Edit</a>
@endHasRole

Next Steps