custom/plugins/MetallitTheme/src/Resources/views/storefront/utilities/icon.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/utilities/icon.html.twig' %}
  2. {% block utilities_icon %}
  3.     {% set styles = [ size, color, rotation, flip, class ] %}
  4.     {# Available icons ... #}
  5.     {% set twtIcons = [ 'avatar', 'bag', 'basket', 'cart', 'envelope', 'heart', 'help', 'home', 'search', 'send', 'stack', 'star', 'x', 'arrow-head-right' ] %}
  6.     {# Available iconsets ... #}
  7.     {% set twtIconSets = [ 'bx', 'bx-alt', 'bxs', 'bxs-alt', 'fa-free', 'fa-free-alt', 'fa6-free', 'fa6-free-alt', 'feather', 'material', 'sw6', 'twt-light', 'twt-one-outline', 'twt-one-solid', 'twt-one-thin', 'twt-six', 'twt-six-solid' ] %}
  8.     {# Set iconset via theme configuration ... #}
  9.     {% set twtIconSet = theme_config('twt-iconset') %}
  10.     {%- if pack is not defined -%}
  11.         {% set pack = 'default' %}
  12.     {%- endif -%}
  13.     {%- if namespace is not defined -%}
  14.         {% set namespace = 'Storefront' %}
  15.     {%- endif -%}
  16.     {# Include icon ... #}
  17.     {% if twtIconSet is not same as ('default') and twtIconSet in twtIconSets and pack == 'themeware' and name in twtIcons %}
  18.         {% sw_include '@Storefront/storefront/themeware/twt-iconsets.html.twig' with {
  19.             styles: styles,
  20.             set: twtIconSet
  21.         } %}
  22.     {% else %}
  23.         {% if pack is not defined or pack == 'themeware' %}
  24.             {% set pack = 'default' %}
  25.         {% endif %}
  26.         <span class="icon icon-{{ name }}{% for entry in styles %}{% if entry != "" %} icon-{{ entry }}{% endif %}{% endfor %}">
  27.             {% if pack == 'metallit' %}
  28.                 {{ source('@MetallitTheme/app/storefront/dist/assets/icon/metallit/'~ name ~'.svg', ignore_missing = true) }}
  29.             {% else %}
  30.                 {% set icon = source('@' ~ namespace ~ '/assets/icon/'~ pack ~'/'~ name ~'.svg', ignore_missing = true) %}
  31.                 {{ icon|sw_icon_cache|raw }}
  32.             {% endif %}
  33.         </span>
  34.     {% endif %}
  35. {% endblock %}