templates/platform/component/atom/link.html.twig line 1

Open in your IDE?
  1. {#
  2. Clefs disponibles
  3.     - enabled
  4.     - tel
  5.     - mailto
  6.     - url
  7.     - route
  8.     - params
  9.     - class
  10.     - target
  11.     - content
  12.     ## Optionnel pour title_paragraph => wrapper.class
  13. #}
  14. {% if link.enabled is not defined or link.enabled %}
  15.     {% set url = getItemLink(link) %}
  16.     {% if app.user %}
  17.         {% set userPoint = getAvailablePointOfUser(app.user) %}
  18.     {% endif %}
  19.     {% if url is not same as('') %}
  20.         <a href="{{ url }}"
  21.            class="{% if link.button is defined %}{{ link.button }}{% elseif link.class is defined%}{{ link.class }}{% endif %}"
  22.                 {% if link.target is defined %}target="{{ link.target }}"{% endif %}>
  23.             {% if link.alternative_content_no_point is defined and userPoint is defined and userPoint == 0 %}
  24.                 {{ link.alternative_content_no_point|trans|raw }}
  25.             {% else %}
  26.                 {{ link.content|trans|raw }}
  27.             {% endif %}
  28.         </a>
  29.     {% else %}
  30.         <span class="badge badge-danger">{{ 'link avec url non définie'|trans }}</span>
  31.     {% endif %}
  32. {% endif %}