mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/structural_pages.git
synced 2026-05-05 09:50:41 -03:00
Reescreve structural-pages-menu.css com layout horizontal como padrão (análogo ao microsite-nav) e flyout lateral apenas em contexto sidebar. Extrai renderização de itens para structural-pages-menu-item.html.twig e adiciona link "Home" apontando para a URL do ancestral. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.3 KiB
Twig
36 lines
1.3 KiB
Twig
{#
|
|
/**
|
|
* @file
|
|
* Template for the structural pages menu block.
|
|
*
|
|
* Available variables:
|
|
* - ancestor: The ancestor entity (term, user, or group).
|
|
* - ancestor_url: The ancestor URL string.
|
|
* - tree: Array of menu tree items, each containing:
|
|
* - id: Node ID.
|
|
* - title: Node title.
|
|
* - url: Node URL.
|
|
* - is_redirect: Whether the link is a redirect.
|
|
* - depth: Current depth level.
|
|
* - children: Array of child items (same structure).
|
|
* - active_trail: Array of node IDs in the active trail.
|
|
* - show_ancestor_title: Whether to show the ancestor title as header.
|
|
*/
|
|
#}
|
|
{% if tree is not empty %}
|
|
<nav class="block-menu navigation structural-pages-menu" aria-label="{{ 'Site structure navigation'|t }}">
|
|
<div class="block-content">
|
|
<ul class="gva_menu structural-pages-menu__list structural-pages-menu__list--level-1">
|
|
{% if ancestor_url %}
|
|
<li class="menu-item structural-pages-menu__item structural-pages-menu__item--level-1">
|
|
<a href="{{ ancestor_url }}" class="structural-pages-menu__link">{{ 'Home'|t }}</a>
|
|
</li>
|
|
{% endif %}
|
|
{% for item in tree %}
|
|
{% include '@structural_pages/structural-pages-menu-item.html.twig' with {'item': item, 'active_trail': active_trail, 'depth': 1} only %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
{% endif %}
|