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:
@menu('main-navigation')
@menu('main-navigation', 'theme.partials.nav')
@posts
Loop through published posts:
@posts(['limit' => 5, 'category' => 'news'])
<article>
<h2><a href="{{ $post->url }}">{{ $post->title }}</a></h2>
<p>{{ $post->teaser }}</p>
</article>
@endposts
@pages
List pages:
@pages(['parent' => 'about'])
<li><a href="{{ $page->url }}">{{ $page->title }}</a></li>
@endpages
SEO Directives
@seoHead
Output all SEO meta tags:
<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:
<title>@seoTitle</title>
Utility Directives
@breadcrumbs
Display breadcrumb navigation:
@breadcrumbs
@breadcrumbs('theme.partials.breadcrumbs')
@siteSetting
Access a site setting value:
<h1>@siteSetting('site_name')</h1>
<p>@siteSetting('tagline', 'Welcome to our site')</p>
Helper Functions
In addition to directives, FrankenCMS provides helper functions:
{{ frankenField('hero.title') }}
{{ frankenField('hero.title', 'Default Title') }}
{{ siteSetting('site_name') }}
{{ currentContent()->title }}
Conditional Directives
@isPage('home')
<div class="home-specific">...</div>
@endIsPage
@isPost
<div class="post-meta">...</div>
@endIsPost
@hasRole('editor')
<a href="/admin">Edit</a>
@endHasRole