{# /** * @file * Template for a single structural pages menu item (recursive). * * Available variables: * - item: Menu item array with keys: * - id: Node ID. * - title: Node title. * - url: Node URL string. * - is_redirect: Whether the link is a redirect. * - children: Array of child items. * - active_trail: Array of node IDs in the active trail. * - depth: Current depth level (integer). */ #} {% set is_active = item.id in active_trail %} {% set has_children = item.children is not empty %} {% set classes = [ 'menu-item', 'structural-pages-menu__item', 'structural-pages-menu__item--level-' ~ depth, is_active ? 'menu-item--active-trail structural-pages-menu__item--active-trail' : '', has_children ? 'menu-item--expanded structural-pages-menu__item--has-children' : '', ]|filter(c => c is not empty)|join(' ') %}