badge.twig

Same filename in other branches
  1. 11.x core/profiles/demo_umami/themes/umami/components/badge/badge.twig
<div{{ attributes.addClass('umami-badge') }}>
  <div class="umami-badge__container">
    {% if icon %}
      <div class="umami-badge__icon">
        {{ source(componentMetadata.path ~ '/icons/' ~ icon|default('knife') ~ '.svg') }}
      </div>
    {% endif %}
    {% if block('label') is defined and block('label')|trim %}
      <div class="umami-badge__label">{% block label %}{% endblock %}</div>
    {% endif %}
    {% block text %}{% endblock %}
  </div>
</div>

File

core/profiles/demo_umami/themes/umami/components/badge/badge.twig

View source
  1. <div{{ attributes.addClass('umami-badge') }}>
  2. <div class="umami-badge__container">
  3. {% if icon %}
  4. <div class="umami-badge__icon">
  5. {{ source(componentMetadata.path ~ '/icons/' ~ icon|default('knife') ~ '.svg') }}
  6. </div>
  7. {% endif %}
  8. {% if block('label') is defined and block('label')|trim %}
  9. <div class="umami-badge__label">{% block label %}{% endblock %}</div>
  10. {% endif %}
  11. {% block text %}{% endblock %}
  12. </div>
  13. </div>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.