app/template/default/Block/cat_img.twig line 2

Open in your IDE?
  1. {% macro getCategoryImage(category) %}
  2.     {% if category.category_image %}
  3.         {{ asset(category.category_image|no_image_product, 'save_image') }}
  4.     {% elseif category.Parent %}
  5.         {{ _self.getCategoryImage(category.Parent) }}
  6.     {% else %}
  7.         {{ asset('/html/user_data/assets/img/headimg.png') }}
  8.     {% endif %}
  9. {% endmacro %}
  10. {% import _self as macros %}
  11. <div class="category-head">
  12.     <img src="{{ macros.getCategoryImage(Category) }}" alt="{{ Category.name }}">
  13. </div>
  14. <div class="cat-name-box">
  15.     {% if Category %}
  16.         {% for Path in Category.path %}
  17.             {% if loop.last %}
  18.                 <div class="cat-name-sbox"><p>{{ Path.name }}</p></div>
  19.             {% endif %}
  20.         {% endfor %}
  21.     {% endif %}
  22. </div>