I am having a problem using MYTHEME.theme file to add image field in the menu item object. I need to be able to specify an image for each menu link/item!
function HOOK_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type->id() == 'menu_link_content')
{
$fields['menu-image'] = BaseFieldDefinition::create('image')
->setLabel(t('Image shown next to menu name'))
->setComputed(TRUE);
}
return $fields;
}
I don't think that this code actually runs, I cannot see any effects!