Neorio.
TCTwill CMS
•Created by Neorio. on 12/16/2024 in #👊support
How to insert & render media with block editor to frontend?
Hi! i am new to twill CMS and i wanted to ask some help here, any answer would help me alot!
in this case, i am using some block that named carousel and must insert at least 1 media (photo) inside it and i set it up to 5 Images per block that i made.
@twillBlockTitle('Carousel')
@twillBlockIcon('b-carousel')
@twillBlockGroup('app')
<x-twill::medias
name="cover"
label="Cover Image"
:max="5"
/>
but when i used dd to the blade directive {{ $block->image('cover', 'default') }} in my preview file, instead of giving img url, it shows me that it returns some base64 encoded string : "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
i've been set my model like this :
use hasMedias;
...
public $mediasParams = [
'cover' => [
'default' => [
[
'name' => 'default',
'ratio' => 16 / 9,
],
],
],
];
and also, when i am trying to put some media inside carousel block and update it through the cms, the medias isn't updated when it refreshed and showing me that "content is saved, All Good" but the actual thing happened isn't saved.
i wonder why this kinda feels wrong here... but i can't tell where.. if this explanation is not enough, i will explain the details! and sorry for my broken english accent!
Peace 🙏
7 replies