How get a programmatically menu fields into template? i add to my main menu an image field programmatically for build a megaMenu :

/**
 * Implements hook_entity_base_field_info().
 */
function hook_entity_base_field_info(EntityTypeInterface $entity_type) {

    $fields = [];


    if ($entity_type-&gt;id() == 'menu_link_content') {


        $year = date('Y');
        $month = date('m');

        $fields['image'] = BaseFieldDefinition::create('image')
            -&gt;setLabel(t('Image'))
            -&gt;setDescription(t('Image field'))
            -&gt;setSettings([
                'file_directory' =&gt; 'imagesMenu'. '/' . $year . '/' . $month,
                'alt_field_required' =&gt; FALSE,
                'file_extensions' =&gt; 'png jpg jpeg',
            ])
            -&gt;setDisplayOptions('view', array(
                'label' =&gt; 'hidden',
                'type' =&gt; 'default',
                'weight' =&gt; 0,
            ))
            -&gt;setDisplayOptions('form', array(
                'label' =&gt; 'hidden',
                'type' =&gt; 'image_image',
                'weight' =&gt; 0,
            ))
            -&gt;setDisplayConfigurable('form', TRUE)
            -&gt;setDisplayConfigurable('view', TRUE);
    }

    return $fields;
}


After a drush update-entity, i can see the field on my form and i can add the image.

Now i try to get this field into twig.

When i use kint with keys this is the result :


  menu--main.html.twig




I cannot see my field image.

Any idea how can i get my field in tempalte ? hook_preprocess for the menu ?
This is how i get my custom image field from menu into twig

function hook_preprocess_menu(&amp;$variables, $hook) {

    if($variables['theme_hook_original'] == 'menu__main'){

            $items = $variables['items'];
            foreach ($items as $key =&gt; $item) {

                if(count($item['below'])&gt;0)
                {
                    foreach($item['below'] as $id=&gt;$array)
                    {
                        $entity = \Drupal::entityTypeManager()-&gt;getStorage('menu_link_content')-&gt;loadByProperties(array('uuid'=&gt;$array['original_link']-&gt;getDerivativeId()));

                        foreach($entity as $idMenu)
                        {


                            if($idMenu-&gt;get('image')-&gt;entity != null) {


                                $image = file_create_url($idMenu-&gt;get('image')-&gt;entity-&gt;getFileUri());

                                $items[$key]['below'][$id]['imageUrl'] = $image;


                            }
                        }

                    }

                }

            }

        $variables['items']=$items;

    }

}


I just work on my item menu and add 'imageUrl' into my array.
I first load my entity by properties with the UUID for access to my menu item fields.

This method is only for my sub menu ( inside my mega menu, i want just add an image by item in submenu ) 


  that why i check count(item['below']>0)




For now i can't find better way.