Images of subcategories as data attributes in menu

If there is a subcategory image set in admin, respective menu items have this image URL available in data attribute data-image. This allows you to implement visually richer menus in any template.

Example:
<ul class="menu-level-2">
    <li class="menu-item-702">
        <a href="/saty-a-sukne/" title="Šaty a sukně" data-image="https://cdn-vsh.myshoptet.com/usr/step.shoptet.cz/user/categories/thumb/womens-patterned-dress-redfloral-hm-red-dresses_1.jpg">
            <span>Šaty a sukně</span>
        </a>
    </li>
    ...
</ul>

Post navigation