Load child menu in Drupal 8

06/07/2018


Assuming I have the following menu structure

Main Menu
- Subjects
-- Subject 1
-- Subject 2
- Brands
-- Brand 1
-- Brand 2
....

I have a block in which I can choose which submenu to display in that block. Notice that only the 1st level of the Main menu is displayed in the block settings.

It looks something like this:

In the block settings I save the submenu uuid as the key and the name(Subjects, Brands, etc) as the value.

Later on I load the block settings in a region.

I want, by using the uuid of the submenu to load all of its children and get the title and link.

How can I do that.

قالب وردپرس