Turn Drupal 8.x menu into select list with Twig

One a recent 8.x web project I had to get a menu as a select list to use it on the mobile versions of the website. The menu was 2 level depth but the pattern can be used for every level menus. Each select list options havs a data-url value taken from the menu path so the select list can be used with js to trigger a page redirect on select change...

read more
Subscribe to Blog posts for: twig