templates/ProfileList/list.profiles.html.twig line 1

Open in your IDE?
  1. {# {% set result = [] %} #}
  2. {# {% set isTopProfilesExist = top_profile is defined and null != top_profile and null != profiles %}
  3. {{dump( top_profile in profiles.array|keys )}}
  4. {% if isTopProfilesExist and top_profile in profiles.array|keys %}
  5.     {% set result = [] %}
  6.     {% for key, profile in profiles.array %}
  7.         {% if profile != top_profile %}
  8.             {% set result = result|merge([profile])%}
  9.         {% endif %}
  10.     {% endfor %}
  11.     {% set result = [top_profile]|merge(result) %}
  12. {% endif %}
  13. {{dump( result )}} #}
  14. {% set profiles_array = [] %}
  15. {% if profiles != null %}
  16.     {% if profiles.array is defined %}
  17.         {# Legacy listing provider #}
  18.         {% set profiles_array = profiles.array %}
  19.     {% else %}
  20.         {# New listing microservice. Profiles array already contains top placement #}
  21.         {% set profiles_array = profiles %}
  22.     {% endif %}
  23. {% endif %}
  24. {% set hidePreferredButton = hidePreferredButton is defined ? hidePreferredButton : false %}
  25. {% set likeButton = likeButton is defined ? likeButton : false %}
  26. {%- for profile in profiles_array -%}
  27.     {%- set lazyLoad = loop.index == 1 -%}
  28.     {% include 'ProfileList/profile.html.twig' with {
  29.         profile: profile,
  30.         lazyLoad: lazyLoad,
  31.         isProfileTop: (loop.first and profile is top_placement)
  32.     } %}
  33. {%- endfor -%}