Evo 2.0 pagebuilder controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
$this->data['pagebuilder'] = $this->evo->runSnippet('PageBuilder', ['renderTo' => 'array'])[0]; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if($block['image']) | |
<img src="{{ $block['image'] }}"> | |
@endif | |
{!! $block['richtext'] !!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@foreach($pagebuilder as $block) | |
@include('partials.pagebuilder.'.$block['block_id'], $block) | |
@endforeach |
Надо добавить еще пример контейнера
Надо добавить еще пример контейнера
Никогда не использовал их, потому что не понял, зачем они нужны...
Понял :) обьясню в видео :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that imgtext.blade.php placed in views/partials/pagebuilder/
No need for
templates
section in pagebuilder block config - processed by view