Last active
April 28, 2016 09:37
-
-
Save rupertj/b941f0ba5912c0083295d2f00f29dfa0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$parameters = new MenuTreeParameters(); | |
$parameters->setMaxDepth(2)->onlyEnabledLinks(); | |
$menuTreeService = Drupal::menuTree(); | |
$tree = $menuTreeService->load('main', $parameters); | |
if ($tree) { | |
$build = $menuTreeService->build($tree); | |
// Switch the theme back from menu--main. While this *is* the main menu, we don't want it to pick up that styling. | |
$build['#theme'] = 'menu__footer'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment