{% if entities|length>0%}
<ul>
{% for entity in entities %}
{% if (entity.visible) %}
{%if actual==entity.id or parentDisabled==1%}
{%set disabled=1%}
{%endif%}
{#%if disabled==1 %}disabled="disabled"{%endif%} {%if selected==entity.id%}selected="selected"{%endif%#}
{% set sUrl = '#' %}
{% if (attribute(entity, 'url'~(app.request.locale|capitalize)) != '') %}
{% set sUrl = attribute(entity, 'url'~(app.request.locale|capitalize)) %}
{%else%}
{%if entity.getPagina() is not null%}
{#{ dump (entity.getPagina()) }#}
{#{attribute(entity.getPagina(), 'slug'~(app.request.locale|capitalize))}#}
{% set sUrl = path ('paginas',
{ '_locale' :app.request.locale,
'_slug' :attribute(entity.getPagina(), 'slug'~(app.request.locale|capitalize))}
)%}
{% else %}
{% if (entity.getRutaArxiu(app.request.locale) != '') %}
{% set sUrl = '/uploads/menu_opcions/'~entity.getRutaArxiu(app.request.locale) %}
{% endif %}
{%endif%}
{%endif%}
<li{% if sUrl == '#' %} class="has-dropdown not-click" {% endif %}>
<a href="{{sUrl}}" target="{{entity.target}}">
{{attribute(entity, 'titol'~(app.request.locale|capitalize))}}
</a>
{{ render(controller('App\\Controller\\frontoffice\\MenuOpcioController::showMenuPrincipalAction', { 'id' : entity.getId(),'level':level+1,'actual':actual,'selected':selected,'parentDisabled':parentDisabled,'nomback':attribute(entity, 'titol'~(app.request.locale|capitalize))})) }}
</li>
{#{dump (entity.children)}#}
{#% include 'App::inc_webMenu.html.twig' with {'entities':entity.children,'level':level+1,'actual':actual,'selected':selected,'parentDisabled':disabled}%#}
{%set disabled=0%}
{% endif %}
{% endfor %}
</ul>
{% endif%}