Render menu in twig template In admin/structure/menu I created a menu. Is it possible to render this menu (with machinename: my_menu) in a twig template? Somehow like:

{{ my_menu }}
Simplify Menu sounds like what you'd want.


  The simplify_menu module uses a TwigExtension to gain access to
  Drupal's main menu's (or any other menu for that matter), render array
  so it can be accessed from a twig template. Among the many advantages
  of having full control of the menu's render array in a twig template
  is the ability to customize the markup for your menus to ensure they
  are accessible and comply with standards.


// Get menu items
{% set items = simplify_menu('main') %}

// Iterate menu tree
&lt;ul&gt;
  {% for menu_item in items.menu_tree %}
    &lt;li class="{{ item_class }} navigation__item"&gt;
      &lt;a href="{{ menu_item.url }}" class="{{ link_class }}"&gt;{{ menu_item.text }}&lt;/a&gt;
    &lt;/li&gt;
  {% endfor %}
&lt;/ul&gt;


Otherwise, there are a handful of menu-* twig templates to use when rendering a menu from a block. Turn on your Twig debugging settings in Drupal to see what the suggestions are.

However, you need to have pretty good knowledge of menu theming to get it exactly right (like handling child items and not flat menu structure as the example above displays) - that said, I would stick to letting a block render out the menu in a given region. Then, inspect menu.html.twig from your base theme (either classy or stable) to get an idea of what your options are if you want to modify markup. 

Be sure to use a decent twig template suggestion and not just menu.html.twig - as that will affect every menu that gets rendered by Drupal... it is the default template.

I would also suggest to install Menu Block as that will grant extra flexibility in theming and twig file suggestions. It also makes rendering trees of a menu (like section based navigation in a sidebar) a breeze.