Adding dropdown menu functionality to Drupal 8 themes

Submitted by admin on Thu, 10/13/2016 - 11:31
polygons

Dropdown menus are easy to build using Uikitty and Drupal 8.

Activating a dropdown menu when you are using Uikitty as a base theme is as simple as updating the Twig template for the menu with a few attributes.

First make sure you have the newest update of the Uikitty base theme.

Now just make sure to check the box for "show as expanded" under the menu admin for term getting the dropdown and also make sure to allow the block levels to go further than 1 level deep. Now your dropdowns will show automatically using the nav component of uikit. This works because the logic for the dropdowns is added to the uikitty base theme. It can be overridden if you want to display the dropdown with a different icon for instance than the downward triangle.

Tags