templates/default/menu_item.html.twig line 1

  1. {% for rama in arbol %}
  2.         {% if rama.translations[locale] is defined %}
  3.             {% set ramat =  rama.translations[locale] %}
  4.         {% else %}
  5.             {% set ramat = null %}
  6.         {% endif %}
  7.         
  8.         {% if ramat and rama.activo == 1 %}
  9.         
  10.             {% if ( deep == 0 and  (zona == "principal"))  %}
  11.                 
  12.                 {% set uriPath = uri|split('://')|last %}
  13.                 {% set uriPath = uriPath|split('/')|slice(1)|join('/') %}
  14.                 
  15.                 {% if rama.__children %}
  16.                     <li class="nav-item dropdown sub{{ deep }} {% if loop.last and false %}ms-auto{%endif%}">
  17.                         <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  18.                             {{ ramat.titulo }}
  19.                         </a>
  20.                         <ul d="subMenu-{{ramat.id}}" class="dropdown-menu subMenu{{ deep }} {{tema}} collapse cf" data-button="#sub-button-{{ramat.id}}" >
  21.                             {% if rama.__children %}
  22.                                 {% include "default/menu_item.html.twig" with {'arbol': rama.__children, 'deep': deep + 1, 'tema':tema } %}
  23.                             {% endif %}
  24.                         </ul>
  25.                     </li>
  26.                 {%else%}
  27.                     <li class="nav-item sub{{ deep }} {% if loop.last and false %}ms-auto{%endif%}">
  28.                         <a class="nav-link {% if uriPath == ramat.url or ramat.url == "/"~uriPath or ( ramat.url == '/blog' and blog == "1") %}active{% endif %}" aria-current="page" href="{% if rama.tipo != 'Enlace' %}{{ path('index') }}{% if ramat.url != "/" %}{% if locale != 'es' %}/{% endif %}{{ ramat.url }}{% endif %}{%else%}{{ ramat.url }}{%endif%}" target="{{ rama.target }}">{{ ramat.titulo }}<span></span></a>
  29.                     </li>
  30. {#                    {{ ramat.url~"/" }} {{ "/"~uriPath }}#}
  31.                 {% endif %}
  32.             
  33.             
  34.             {% else %}
  35.             
  36.                 <li class="nav-item sub{{ deep }}">
  37.                     <a class="nav-link {% if uri == url('index')~ rama.translations.es.url %}active{% endif %}" aria-current="page" href="{% if rama.tipo != 'Enlace' %}{{ path('index') }}{% if ramat.url != "/" %}{% if locale != 'es' %}/{% endif %}{{ ramat.url }}{% endif %}{%else%}{{ ramat.url }}{%endif%}" target="{{ rama.target }}">{{ ramat.titulo }}<span></span></a>
  38.                 </li>
  39.                 
  40.                 {# {% if rama.__children %}
  41.                         <ol id="subMenu-{{ramat.id}}" class="subMenu subMenu{{ deep }}  collapse cf" data-button="#sub-button-{{ramat.id}}" >
  42.                             {% if deep == 0 %}
  43.                             <div class="container np">
  44.                             {% endif %}
  45.                             
  46.                             {% include "ZonaBundle:Default:menuItem.html.twig" with {'arbol': rama.__children, 'deep': deep + 1 } %}
  47.                             
  48.                             {% if deep == 0 %}
  49.                             </div>
  50.                             {% endif %}
  51.                         </ol>
  52.                 {% endif %}    #}    
  53.             
  54.             {% endif %}
  55.         {% endif %}
  56. {% endfor %}