How get a programmatically menu fields into template?
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.