Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Evo 2.0 pagebuilder controller
...
$this->data['pagebuilder'] = $this->evo->runSnippet('PageBuilder', ['renderTo' => 'array'])[0];
...
<?php
return [
'title' => 'Image with text',
'fields' => [
'image' => [
'caption' => 'Image',
'type' => 'image',
],
'richtext' => [
'caption' => 'Text',
'type' => 'richtext',
'default' => '',
'theme' => 'mini',
'options' => [
'height' => '100px',
],
],
],
//pass block id to data
'prepare' => function($options, &$values) {
$values['block_id'] = 'imgtext'; //partial name for inclusion
}
];
@if($block['image'])
<img src="{{ $block['image'] }}">
@endif
{!! $block['richtext'] !!}
@foreach($pagebuilder as $block)
@include('partials.pagebuilder.'.$block['block_id'], $block)
@endforeach
@sashabeep
Copy link
Author

sashabeep commented Nov 20, 2019

Note that imgtext.blade.php placed in views/partials/pagebuilder/
No need for templates section in pagebuilder block config - processed by view

@Dmi3yy
Copy link

Dmi3yy commented Nov 20, 2019

Надо добавить еще пример контейнера

@sashabeep
Copy link
Author

sashabeep commented Nov 20, 2019

Надо добавить еще пример контейнера

Никогда не использовал их, потому что не понял, зачем они нужны...

@Dmi3yy
Copy link

Dmi3yy commented Nov 20, 2019

Понял :) обьясню в видео :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment