Hi there,
I’m setting up my first Kirby site. Loving it until now. (and love the fact that I can use Blade templating ;-))
I have a problem with the new editor though. Probably something simple but can’t seem to get my head around it.
I’m using pages as sections that you can fill up with the new editor but when i echo $page->text()->blocks()
or $page->text()->blocks()->html()
I get nothing. Although if I var_dump them I do get something back.
I’ll elaborate a bit on my setup. (btw, it’s not the blade engine, I also tried everything with just simple php tags & echo’s)
Blueprint
title: Hero
preset: page
pages: false
changeTemplate: false
fields:
text:
label: Text
type: editor
Listing the sections (Had to remove the @'s from blade because the form thought I was mentioning people)
section('content')
foreach($page->children()->listed() as $section)
include($section->template())
endforeach
endsection
Example of an paragraph with the blocks
<p class="paragraph">
{!!var_dump($section->text()->blocks())!!}
{!!$section->text()->blocks()->html()!!}
</p>
Output of the var dump
Content of the field
[
{
"attrs": [],
"content": "Test",
"id": "_jm5tx7197",
"type": "paragraph"
}
]
If I var_dump the ->html() I get nothing.
Any ideas?