This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
jawainc16180
I'm building plugin to add image in menu but it did not work
public function boot()
{
// Menu
Event::listen('backend.form.extendFields', function ($widget) {
if (
!$widget->getController() instanceof \RainLab\Pages\Controllers\Index ||
!$widget->model instanceof \RainLab\Pages\Classes\MenuItem
) {
return;
}
$widget->addTabFields([
'viewBag[menu_item_image]' => [
'tab' => 'Menu Image',
'label' => 'Menu Item Image',
'comment' => 'Menu item image will be shown with title',
'type'=> 'mediafinder',
'mode' => 'image'
],
]);
});
}
it shows new tab with image placeholder, but it never save selected image.
Any suggestions ?
1-2 of 2