This file contains 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); |
This file contains 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
<?php | |
/** | |
* Implements hook_preprocess_HOOK for field--field-structured-content-section.html.twig | |
*/ | |
function TEMPLATE_preprocess_field__field_structured_content_section(&$variables) { | |
$items = $variables['items']; | |
foreach ($items as &$item) { | |
$paragraph = $item['content']['#paragraph']; | |
$para_type = $paragraph->getType(); |