{% set supurl = '' %}
{% if spec != '' %}
{% set supurl = spec ~ '/' %}
{% endif %}
{% if speccatmenu_search %}
{% set search = '?q=' ~ speccatmenu_search %}
{% else %}
{% set search = '' %}
{% endif %}
{% set menu = speccatmenu_menu %}
{% set spec = speccatmenu_spec ?: 'default' %}
{% set catpages = speccatmenu_catpages %}
{% set parent_id = speccatmenu_parent_id %}
{% set cat_id = speccatmenu_cat_id %}
<ul class="desktop-menu">
{% for cat in menu[0] %}
{% if cat.prods or spec == 'default' or spec == '' %}
<li class="cat-active">
{% if spec == 'new' or spec == 'pop' or spec == 'action' or spec == 'mix' or spec == 'onsale' or spec == 'search' or spec == 'selection1' or spec == 'selection2' %}
<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 jsddm-speccatmenu">
{% for subcat in menu[cat.id] %}
{% if subcat.prods or spec == 'default' or spec == '' %}
<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' or spec == '' %}
<li class="sc2{% if subsubcat.newlabel %} newsubcat{% endif %}" {% if p % 3==0 %} style="clear: both;" {% endif %}{% set p=p + 1 %}>
{% if spec == 'default' or spec == '' %}
<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' or spec == 'selection1' or spec == 'selection2' %}
<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>
{# {% if catpages[subcat.id] is defined %}
{% for catpage in catpages[subcat.id] %}
<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">
-- {{ catpage.name | raw }}
</a>
{% endfor %}
{% endif %} #}
{% 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' or spec == 'selection1' or spec == 'selection2' %}
<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>
<style>
</style>
{#
<script>
console.log('###');
document.addEventListener('DOMContentLoaded', function () {
if (document.body.clientWidth >= 975) {
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function jsddm_canceltimer2() {
if (closetimer) {
window.clearTimeout(closetimer);
closetimer = null;
}
}
function jsddm_close2() {
if (ddmenuitem) ddmenuitem.style.display = 'none';
}
function jsddm_timer2() {
closetimer = window.setTimeout(jsddm_close2, timeout);
}
function jsddm_open2() {
jsddm_canceltimer2();
jsddm_close2();
ddmenuitem = this.querySelector('ul').style.display = 'block';
}
const menuItems = document.querySelectorAll('.jsddm-speccatmenu > li');
menuItems.forEach(item => {
item.addEventListener('mouseover', jsddm_open2);
item.addEventListener('mouseout', jsddm_timer2);
});
} else {
}
});
</script>#}