Rich editor custom block and spatie media library

I have a richtext editor field, where I am using RichContentCustomBlock. One of these blocks should also use an image upload in the form of spatie media library field:
public static function configureEditorAction(Action $action): Action
{
return $action
->modalDescription('Configure the hero block')
->schema([
SpatieMediaLibraryFileUpload::make("image"),
TextInput::make("title")
]);
}
public static function configureEditorAction(Action $action): Action
{
return $action
->modalDescription('Configure the hero block')
->schema([
SpatieMediaLibraryFileUpload::make("image"),
TextInput::make("title")
]);
}
This works somehow. I can upload an image. But I can't access it, in the toHtml method:
public static function toHtml(array $config, array $data): string
{
dd($config, $data);
}
public static function toHtml(array $config, array $data): string
{
dd($config, $data);
}
In config, there is only title. This makes sense, since there is no real connection between the created media library entry and the current block? Is this just not implemented, or am I doing something wrong?
2 Replies
tundratech
tundratech3w ago
I am having the same issue. Did you ever find a solution?
bernhard
bernhardOP3w ago
@tundratech nope. I couldn't solve the issue.

Did you find this page helpful?