{% set supurl = '' %}
{% if spec != '' %}
{% set supurl = spec ~ '/' %}
{% endif %}
{% if search %}
{% set search = '?q=' ~ search %}
{% else %}
{% set search = '' %}
{% endif %}
<ul class="desktop-menu">
{% for cat in menu[0] %}
{% if cat.prods or spec == 'default' %}
<li class="cat-active">
{% if spec == 'new' or spec == 'pop' or spec == 'action' or spec == 'mix' or spec == 'onsale' or spec == 'search' %}
<a href="{{ path('prod_list_cat_spec', {'cat_id': cat.id, 'cat_intname': cat.intname, 'spec': spec}) ~ search }}" class="leftcatmenuli">{{ cat.name |raw }} ({{ cat.prods }})</a>
{% else %}
<a href="{{ path('prod_list_cat', {'cat_id': cat.id, 'cat_intname': cat.intname}) ~ search }}" class="leftcatmenuli">{{ cat.name |raw }}</a>
{% endif %}
{% if menu[cat.id]|length %}
<ul class="jsddm">
{% for subcat in menu[cat.id] %}
{% if subcat.prods or spec == 'default' %}
<li class="{% if menu[subcat.id]|length %}haschildren{% endif %}{% if subcat.id == cat_id or subcat.id == parent_id %} hover{% endif %}{% if subcat.newlabel %} newcat{% endif %}">
{% if menu[subcat.id]|length %}
<div class="sc4">
<ul>
{% set p = 0 %}
{% for subsubcat in menu[subcat.id] %}
{% if subsubcat.prods or spec == 'default' %}
<li class="sc2{% if subsubcat.newlabel %} newsubcat{% endif %}"{% if p % 3 == 0 %} style="clear: both;"{% endif %}{% set p = p + 1 %}>
{% if spec == 'default' %}
<div class="pa w100">
<div class="pa sc4border"></div>
</div>
{% endif %}
{% if spec == 'new' or spec == 'pop' or spec == 'action' or spec == 'mix' or spec == 'onsale' or spec == 'search' %}
<a href="{{ path('prod_list_cat_spec', {'cat_id': subsubcat.id, 'cat_intname': subsubcat.intname, 'spec': spec}) ~ search }}" class="{% if subsubcat.id == cat_id or subsubcat.id == parent_id %}sub-active {% endif %}leftcatmenuli">
{% if subsubcat.newlabel %}
<div class="pa cat-newlabel"><img src="{{ asset('new.png', 'img') }}" alt=""></div>
{% endif %}
{{ subsubcat.name | raw }} ({{ subsubcat.prods }})
</a>
{% else %}
<a href="{{ path('prod_list_cat', {'cat_id': subsubcat.id, 'cat_intname': subsubcat.intname}) ~ search }}" class="{% if subsubcat.id == cat_id or subsubcat.id == parent_id %}sub-active {% endif %}leftcatmenuli">
{% if subsubcat.newlabel %}
<div class="pa cat-newlabel"><img src="{{ asset('new.png', 'img') }}" alt=""></div>
{% endif %}
{{ subsubcat.name | raw }}
</a>
{% endif %}
</li>
{% endif %}
{% endfor %}
<li class="noback" style="clear: both;"></li>
</ul>
</div>
{% endif %}
{% if spec == 'new' or spec == 'pop' or spec == 'action' or spec == 'mix' or spec == 'onsale' or spec == 'search' %}
<a href="{{ path('prod_list_cat_spec', {'cat_id': subcat.id, 'cat_intname': subcat.intname, 'spec': spec}) ~ search }}" class="leftcatmenuli{% if subcat.id == cat_id or subcat.id == parent_id %} active{% endif %}">
{{ subcat.name | raw }} ({{ subcat.prods }})
{% if subcat.newlabel %}
<div class="pa cat-newlabel"><img src="{{ asset('new.png', 'img') }}" alt=""></div>
{% endif %}
</a>
{% else %}
<a href="{{ path('prod_list_cat', {'cat_id': subcat.id, 'cat_intname': subcat.intname}) ~ search }}" class="leftcatmenuli{% if subcat.id == cat_id or subcat.id == parent_id %} active{% endif %}">
{{ subcat.name | raw }}
{% if subcat.newlabel %}
<div class="pa cat-newlabel"><img src="{{ asset('new.png', 'img') }}" alt=""></div>
{% endif %}
</a>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>