mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/structural_pages.git
synced 2026-03-09 18:07:42 -03:00
Add dynamic menu block based on site structure hierarchy
Implements SiteStructureMenuBlock that renders a navigation menu from the ancestor entity (term, user, or group) through all content_page hierarchies. Features configurable depth, active trail highlighting, and proper cache invalidation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,6 +191,29 @@ function _site_structure_creates_circular_reference(int|string $node_id, int|str
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
*/
|
||||
function site_structure_theme(): array {
|
||||
return [
|
||||
'site_structure_menu' => [
|
||||
'variables' => [
|
||||
'ancestor' => NULL,
|
||||
'tree' => [],
|
||||
'active_trail' => [],
|
||||
'show_ancestor_title' => TRUE,
|
||||
],
|
||||
],
|
||||
'site_structure_menu_tree' => [
|
||||
'variables' => [
|
||||
'items' => [],
|
||||
'active_trail' => [],
|
||||
'depth' => 0,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_token_info().
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user